9.8. Styling Lists with CSS

Lists in HTML begin with one of two tags: <ul> for an unnumbered or bulleted list, or <ol> for a numbered or ordered list[5]. These are both container tags, so they end with the respective closing tags, </ul> and </ol>. The items within a list are marked with the <li> tag in both types of lists.

[5] There are other types of lists for glossary items or definitions, directories, and menus, but they are seldom used, so I've omitted them from this discussion. For the most part, they're styled identically to the two major kinds of lists I'll discuss here.

Apart from headings and paragraphs, lists are probably the most commonly used of those elements defined to present textual content to the Web user.

Because lists are ...

Get HTML Utopia: Designing Without Tables Using CSS 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.