Lists

XHTML supports various types of list structure. In all cases, an element that expresses the type of list is used to enclose a number of other elements, each representing one item in the list.

Unordered and ordered lists

The most basic type of list is the Unordered List (Ul). An unordered list is used when the items do not form a logical sequence of steps, and do not need to be separately referenced from elsewhere in the document. It contains a number of List Item (Li) elements. Each of these contains text, and is automatically preceded by a bullet, dash or other symbol:

<ul>
  <li>First Item</li>
  <li>Second Item</li>
  <li>Third Item</li>
</ul>

  • First Item  • Second Item  • Third Item

The Ordered List (Ol) element is similar to the unordered ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.