HTML Lists

We are all familiar with bulleted and numbered lists as used in wordprocessors. The HTML equivalents are known as unordered and ordered lists. The code for specifying both types of list is similar

<?l>
    <li>List text</li>
    ...
    <li>List text</li>
</?l>

where ? is

It is possible to nest lists inside one another. While all browsers make a very good job of interpreting incorrect nesting syntax, it is nevertheless advisable - in the interests of strict XHTML compliance - to use the correct syntax which requires that each nested list be wrapped in an <li>..</li> tag pair owned by the parent list. It is worth noting that browsers don't respond well to having bullet lists nested inside a number list item. On the other hand, number lists inside bullet list items work just fine.

HTML lists are amenable to CSS styling. In addition to the common styling attributes discussed here there are two attributes specific to lists

Jump To...

Colophon