TetSharing
HTML tutorial · 12 chapters
  1. Get started
  2. Elements and attributes
  3. Headings and paragraphs
  4. Text formatting
  5. Links
  6. Images
  7. Lists
  8. Tables
  9. Forms
  10. Input types and controls
  11. Semantic layout
  12. Head and metadata

Final HTML quiz

Chapter 7 of 12 · By Ethan Cole · Updated November 21, 2026

HTML Lists: Unordered, Ordered and Description Lists

Lists are everywhere on the web: navigation menus, feature lists, steps in a recipe, glossaries. HTML has three list types, and choosing the right one tells browsers and assistive technology how the items relate.

Unordered lists

<ul> holds items whose order does not matter, each in an <li>. Browsers draw bullets by default. Navigation menus are usually unordered lists styled with CSS to remove the bullets and line the links up horizontally.

Ordered lists

<ol> is for items where sequence matters, such as installation steps or a top-ten ranking. Browsers number them automatically, so inserting a step renumbers everything. Useful attributes:

  • start="5" begins counting at 5.
  • reversed counts down.
  • type="A", "a", "I" or "i" switches to letters or Roman numerals.
HTML · editable

Expected page text

Shopping list
Notebook
Pens
Blue
Black
Install steps
Download Python
Run the installer
Open a terminal
Glossary
HTML
The structure of a page
CSS
The presentation of a page

Nesting

To create a sub-list, put a complete <ul> or <ol> inside an <li>, after that item's text, as the "Pens" item does. A list placed directly inside another list, outside any <li>, is invalid. The only elements allowed as direct children of <ul> and <ol> are <li> (plus script-supporting elements).

Description lists

<dl> holds groups of terms (<dt>) and descriptions (<dd>). It fits glossaries, metadata such as "Author: Ethan Cole", and FAQ-style pairs. A term can have several descriptions, and several terms can share one description.

Bullets and numbers are presentation

The bullets and numbers are drawn by the browser, not part of the text, which is why the expected page text above contains only the item contents. Change their look with CSS (list-style-type), not by typing characters like "1." or "-" into the items. Screen readers announce lists with their number of items, which helps listeners know what is coming.

Common mistakes

  • Putting text or other elements directly inside <ul> without an <li>.
  • Using an ordered list when order is irrelevant, or typing numbers by hand.
  • Nesting a sub-list outside the <li> it belongs to.

Summary

  • <ul> for unordered items, <ol> for sequences; items go in <li>.
  • start, reversed and type adjust numbering.
  • Nest a sub-list inside an <li>.
  • <dl> pairs terms (<dt>) with descriptions (<dd>).

Quiz: Lists

1. Which elements may be direct children of <ul>?

Only list items (and script-supporting elements) may be direct children.

2. Which attribute makes an ordered list count down?

The boolean reversed attribute numbers items in descending order.

3. Which list type suits a glossary of terms and definitions?

A description list pairs <dt> terms with <dd> descriptions.

Official docs

Written under the pen name Ethan Cole with AI-assisted drafting. Every code example on this page is executed by our test suite before publishing. Found a mistake? Tell us.