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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access