To continue the overview of basic HTML this entry will look at formatting and style tags for text and copy. The following HTML tags allow you to emulate the formatting and style of a word processor for text and copy displayed on the web.
Three common text style are Bold, Italic and Underline. Using your text editor open the index.html file you created for the previous post.
First, make any instance of the acronym â€œHTMLâ€ bold by adding the bold tag as follows.
Next, make the term â€œHyper Text Markup Languageâ€ italic by adding the italic tag.
Finally, you can draw attention to a word, phrase or paragraph by utilizing the underline tag.
Save your work and then open the file in your web browser to see the results.
Some additional formatting tags are:
Copy the following and paste into your text editor.
<h3>Some additional tags:</h3> <em>Emphasis</em> - <em> <strong>Strong</strong> - <strong> <strike>Strike through</strike> - <strike> <big>Big Text</big> - <big> <small>Small text</small> - <small> <q>Short Quotation</q> - <q> <sub>Subscript</sub>Â - <sub> <sup>Superscript</sup> - <sup>
Save your work and refresh the document in you web browser.
Note the formatting for each of the tags, but also note that the list is displayed â€œinlineâ€ like paragraph text. The copy should be displayed as a list and thatâ€™s where ordered and unordered list tags can come in handy.
An ordered list will display items vertically and assign numbers to them. An unordered list will display items vertically as a bulleted list.
Lists are generated using two tags together. First are the ordered or unordered list tags, <ol> for ordered lists and <ul> for unordered list. Then, each item in the list is assigned a â€œList Itemâ€ tag or <li> The <li> tags are â€œnested with in the <ol> or <ul> tags. In HTML a list without content will appear like this:
<ol> <li></li> <li></li> <li></li> </ol> Or <ul> <li></li> <li></li> <li></li> </ul>
Repeat the <li> tag as needed for more list items. Lets use the format sample tags to create a list. This list has no particular hierarchy so an unordered list is appropriate. First create the opening and closing <ul> tags. Then add the list item tags. A quick way to do this would be to copy/paste the opening <li> tag then copy/paste the closing </li> tag.
<ul> <li><em>Emphasis</em> - <em></li> <li><strong>Strong</strong> - <strong></li> <li><strike>Strike through</strike> - <strike></li> <li><big>Big Text</big> - <big></li> <li><small>Small text</small> - <small></li> <li><q>Short Quotation</q> - <q></li> <li><sub>Subscript</sub>Â - <sub></li> <li><sup>Superscript</sup> - <sup></li> </ul>
Please note the opening and closing <li> tags go around the entire list item including itâ€™s formatting tags.
Save your work and refresh your web browser to see the results.
As a quick side note the â€œless than <â€ and â€œgreater than >â€ symbols define the opening and closing of a given tag in HTML. So, some special treatment is needed to make them render as text on the screen so the following combination of keyboard characters will be interpreted as text. < = â€œless than <â€ and > = â€œgreater than >â€.
The above side note provides a good opportunity to explore the <blockquote> tag for paragraph text. Blockquote will indent text to indicate that the text is different from normal paragraph copy. Copy/paste the text into your text editor and add the <blockquote> tags.
Save your work and view it in your browser.
For part three of the Basic HTML series we will look at the proper use of tables for the web. The last part of the series, Basic HTML Part 4, will explore images and hyperlinks.
So stay tuned and, always close your tags!