|
|
||||||
Chapter 3: Working with textIn Chapter 2 you learnt about how HTML is used to create webpages. You also learnt how to set up a new, blank webpage. You are now ready to start adding text to the webpage you started creating in the previous chapter. If you do not yet have a blank document open in the BestAddress HTML Editor, choose New from the File menu. In the dialog box that appears, choose Blank Document and click OK. Enter a title for your page between the You can now type some text between the You can now save your page and preview it in a Web browser. To save it, choose Save As from the File menu. In the dialog box that appears, type a name for your file in the File name box, such as "index", and click Save. For technical reasons for once your webpage is published on the Internet, it is always recommended to save webpages in lower case file names without any spaces. Now that the document has been saved, choose View Page in Browser from the File menu (alternatively, you can also click the
ParagraphsPhysical paragraphs you type into a HTML document are usually ignored. For this reason, you need to manually specify new paragraphs which are to appear in the webpage content by either adding a
or
Although either method can be used, it is recommended that you use the later. Return to your document in the BestAddress HTML Editor and add the following paragraphs to it:
Preview the page in the browser again (you will need to save it first). Your page should look something like this:
You might also like to try using the page break element, <br>. This element is added to a point in the text in which you want to make the text display on the next line after that point. It also differs from the paragraph element in that it does not have an end element (that is an element with a slash (/)). Simple Text FormattingAt the moment, the text on your page is quite plain. If you have ever used a word processing program, you will be aware that there are numerous text styles that can be used including bold, italic and underlined text. These text formatting features are created with the <b>, <i> and <u> elements respectively and in conjunction with their appropriate end elements </b>, </i> and </u>. All have a start and end element. Try modifying the page you are working on as follows:
Now preview the page in the browser to see how it looks. Changing the alignment of textText can be aligned to the left, right, center or justified. You should note, however, that the justification of text is a recent addition to HTML and is therefore only supported by newer browsers.
To change the alignment of text, you will need to learn a new function in HTML - that of an attribute. An attribute is simply another keyword that is added to an element in order to extend the element's existing functionality. An attribute can also contain a value which is defined after an equals sign (=). The following line of code centers text in your document:
In the example above, As mentioned earlier, you can use various other attribute values in place of "center". These include:
As you have probably already noticed, the BestAddress HTML Editor automatically changes the colour of your code based on whether it is an element, attribute or attribute value. While you use BestAddress, you will notice various other colours are used for other types of code. HeadingsMost webpages that you will create will contain at least one size of heading. HTML contains six predefined heading sizes ranging from 1, the largest, to 6, the smallest. The following example shows the code for a large heading:
Typically, you should use the various heading sizes in order. For example, you would use Changing the Font Face, Colour, and SizeUsing the You can easily insert font formatting by choosing Font from the Format menu. You will need to be familiar with the following attributes: Use the Use the
Although the heading elements can be used to change the font sizes of headings, they can not be used for changing the font size within paragraphs since they force a new paragraph to be created. In the case where you want to change the font size within section of a paragraph, you should use the
Where to from here?Now that you have a basic understanding of working with text, you might like to experiment with the knowledge you have gained so far to help build your confidence. Once you feel you have mastered what you have learnt so far, discover how to link between your webpages in Chapter 4: Hyperlinks. |
||||||
![]()
A Multimedia Australia website.
Copyright © 2001 - 2010 Multimedia Australia Pty. Ltd.
Australian Company Number 096 830 394. All rights reserved.
ABN 78 096 830 394
Terms of use. Disclaimer. Privacy Statement.