Lists

There are a few methods with HTML to present a list of items. The two most commonly used are the Ordered List <OL> </OL> and the Unordered List <UL> </UL>. Both types of lists will indent their items and present them in a single column format. The difference is that ordered lists automatically number the items and unordered lists use bullets. You may have noticed that each time I show attributes for a tag I use an unordered list. Each item within a Ordered or Unordered list is designated by a List Item <LI> tag. The <LI> tag does not have a closing tag because when a browser reaches another <LI> or closing list tag (</OL> or </UL>), it knows the previous item is complete.

Lists can be nested, which means you can have lists within lists. They can even be mixed so you can include an ordered list within an unordered list or vice versa. Lists have a few optional attributes, depending on the type. The <LI> tag can have the same attributes the parent list has, this allows you to change numbering/bullets types in the middle of a list.

Ordered Lists: <OL> </OL>
  1. TYPE= refers to the numbering type "A/a/I/i/1":
    1. A - capital letters
    2. a - lowercase letters
    3. I - capital Roman numerals
    4. i - lowercase Roman numerals
    5. 1 - numbers (default).
  2. COMPACT presents a compact list.
  3. START= used in the <OL> tag to set a starting number for the whole list. To change numbers while in the middle of a list, use the <LI VALUE="?"> tag.
Unordered Lists <UL> </UL>
  • TYPE= sets the bullet type to disc, circle or square. This can be set within a <LI> tag to change types in the middle of a list.
  • COMPACT presents a compact list

The next page has some examples of Ordered and Unordered Lists.

>BACK HOME NEXT