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.

Theory in plain words

A nested listli Appleli Mangoulli Fruitsli Vegetablesul
A nested list

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
Bullet list (ul)Try it Yourself
Numbered list (ol)Try it Yourself
Bullet stylesTry it Yourself
Number stylesTry it Yourself
Start from another numberTry it Yourself
Count backwardsTry it Yourself
Set one item numberTry it Yourself
Nested listTry it Yourself
Description list (dl)Try it Yourself
Horizontal menu from a listTry it Yourself

Almost every website menu is a list with CSS.

ChecklistTry it Yourself
Custom bullet colourTry it Yourself
Lists in columnsTry it Yourself
Menu elementTry it Yourself

menu is a list of commands. It looks like ul.

Steps with a listTry it Yourself

Quick quiz

1. Which tag is a numbered list?

2. Which tag is one list item?

3. dt and dd belong to

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.

My notes
Ask a question about this lesson