List types

 

There are three types of lists in HTML and XHTML:

  1. Ordered lists.
  2. Unordered lists.
  3. Definition lists.

The list above is an ordered list (ol) using numbers. Other styles are letters, such as A, B and C or roman characters such as i, ii and iii. A standard ordered list uses numbers and start counting at 1. The HTML for such a list is as follows:

<ol>
  <li>Item one</li>
  <li>Item two</li>
</ol>

The second type is an unordered list (ul). Unordered lists use styles like bullets, squares, images or circles. The HTML for such a list is as follows:

<ul>
  <li>Item one</li>
  <li>Item two</li>
</ul>

The third type of list is a definition list (dl). This list is not very common and this list is not covered in this article.