Markup for three types of lists are provided in XHTML:
-
Unordered (ul): no obvious ordering to the items in the list
-
Ordered (ol): clear ordering of the items in the list
-
Definition (dl): a list of terms followed by an associated description
It is not always obvious which one to choose!
- Start and end tags are always needed
-
dl, ul and ol are standard block-level elements
- The <li> element is used to specify list items
in ul and ol lists
- The li element is neither a block level or inline
element because:
- It can only appear as a child of the ul or ol elements
- It behaves like a div
- Browsers normally render it with the list bullet or number
outside the content box
- A browser normally renders a bullet in front of each unordered list item
- A browser normally renders a number in front of each ordered list item
- By default, the browser chooses the type of bullet or form of number