Creating Lists

HTML supports three kinds of lists: ordered, unordered, and definition.

An ordered list is a list in numeric order. HTML adds the numbers. If you remove an item from the list, HTML automatically updates the numbers. For example, You might want to list items in order from the most important to the least important. To do so, you could enter the following code into your HTML document:

<H3> Item List Name <./H3>
<OL>
<LI> Item One
<LI> Item Two
<LI> Item Three
</OL>

A Web browser might display the code as:
 
 

Item List Name

  1. Item One
  2. Item Two
  3. Item Three

This shows the basic structure of an HTML list. The list text is bracketed between the <OL> and </OL> tags, where OL stands for ordered list. This tells the browser to present the text between the tags as an ordered list. Each list item is identified by a single <LI> tag, where LI stands for list item. There is no closing tags for list items.

An unordered list is one in which list items have no particular order. Browsers usually format unordered lists by inserting a bullet symbol before each list item. The entire list is bracketed between the <UL> and </UL> tags, where UL stands for unordered list. This is perfect to display items without regard to their importance. To do so, you could enter the following code:

<H3> Item List Name </H3>
<UL>
<LI>Item One
<LI>Item Two
<LI>Item Three
</UL>

A Web browser might display the code as:
 
 

Item List Name

  • Item One
  • Item Two
  • Item Three

The Third type of list that HTML can display is a definition list. A definition list is a list of terms, each followedd by a definition line, usually indented slightly to right. The <LI> tag used in ordered and unordered lists for individual items is replaced by two tags: the <DT> tag used for each term in the list and the <DD> tag used for each term's definition. As with the <LI> tag, both of those tags are one-sided. The entire list is bracketed by the <DL> and </DL> tags indicating to the browser that the list is a definition list. To make one of these list you could enter the following code:

<H3> List Name </H3>
<DL>
<DT>Item One  <DD> Description of Item One
<DT>Item Two <DD> Description of Item Two
<DT>Item Three <DD> Description of Item Three
</DL>

A Web browser might display the code as:
 
 

List Name

Item One
Description of Item One
Item Two
Description of Item Two
Item Three
Description of Item Three



previous page back to main help page next page