Body Tags

Since browsers read from HTML tag to HTML tag, you must be very specific in indicating when you wish to start (and when you wish to stop!) any given formatting type. These type of tags are referred to as “container tags” since the text “contained” within the starting and stopping tags is the information affected.

The paragraph container tags start and stop paragraphs: <P>…</P>. Within the paragraph container you can type text, embed other tags, display images or tables, or create links to other files or locations. The paragraph tag <P> causes a blank line to separate paragraphs.

The horizontal rule line does not have to be closed. Whenever you use the <HR> tag, a “shadowy” horizontal rule line is placed in your document. Rule lines are useful for separators within your document but should be used minimally since they often indicate to the reader: “stop reading here.”

The second tag that does not have to be closed is the <BR> tag. The break tag functions like a hard return.

Special emphasis tags include <B>…</B> (for bold emphasis) and <I>…</I> (to create italics). You can create underline by using the container tags <U>…</U>. Keep in mind, though, that many users associate underlining with a link and may attempt to “click” on underlined text.

To create indented lists with either bullets or numbers, you will use tags for unordered (bulleted) and ordered (numbered) lists in combination with the list item <LI> tag.

An unordered list example:

<UL>
<LI>Apples<LI>
<LI>Pears<LI>
<LI>Bananas<LI>
</UL>

will result in:

* Apples
* Pears
* Bananas

An ordered list example:

<OL>
<LI>Introduction<LI>
<LI>Objectives<LI>
<LI>Conclusion<LI>
</OL>

will result in:

1. Introduction
2. Objectives
3. Conclusion

You may also “nest” tags within one another to create “sub-lists.”

For example,

<OL>
<LI>Chapter One<LI>
<LI>Chapter Two<LI>
<UL>
<LI>Part A<LI>
<LI>Part B<LI>
<LI>Part C<LI>
</UL>
<LI>Chapter Three<LI>
</OL>

would result in:

1. Chapter One
2. Chapter Two
* Part A
* Part B
* Part C
3. Chapter Three

It is important when nesting tags that they be closed in the reverse order opened. For example if you created bold italics, the code would be <B><I>bold italics</I></B>. Notice that the emphasis tag was the last one opened and, therefore, was the first one closed. This is one area where most of the popular HTML editors “fall down on the job.” Invariably, the tags are closed in the same order as they were opened, rather than the reverse order. Most times, this does not cause any problems; however, occasionally, you will find browsers that will simply ignore all but one of the tags since it is “confused” or will continue to display text in one or the other attribute even past the closing tag.

© 2007 - 2008 tutorial.webaccessories