Home / Learn HTML / HTML Lists
HTML Lists
Lists group related items. There are bullet lists, numbered lists and description lists.
Definition
Lists group related items. HTML has three kinds: the unordered list ul (bullets), the ordered list ol (numbers) and the description list dl (terms with descriptions). Each item of ul and ol is an li; in dl they are dt and dd.
- Choose
olonly when the order matters. - Lists can be nested: put a new
ulinside anli. - Menus are usually built as a
ulinsidenavand then styled with CSS.
Theory in plain words
What it is
HTML has three list types: ul (bullets), ol (numbers) and dl (terms and descriptions).
Why we use it
Lists group related items and tell software "these belong together". Menus are usually lists too.
How it works
Each item is an li. The browser draws bullets or numbers and indents. Lists can be nested inside li.
Where it is used
- Navigation menus
- Steps and rankings
- Glossaries and specs
Almost every website menu is a list with CSS.
menu is a list of commands. It looks like ul.
Quick quiz
1. Which tag is a numbered list?
ol is ordered.
2. Which tag is one list item?
li goes inside ul or ol.
3. dt and dd belong to
Description lists use dl.
Common questions
Which tag is a numbered list?
<ol>. ol is ordered.
Which tag is one list item?
<li>. li goes inside ul or ol.