Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 1.5 — Lists
HTML · Example 1 of 2

All three kinds of list

The method has 3 top-level steps, but 5 li elements in total because the sub-steps count too.

HTML has three lists: <ul> when order doesn't matter, <ol> when it does (with start, reversed and type to control the numbers), and <dl> for terms and their descriptions; lists can nest inside list items.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 5 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Write a top-5 list of your favourite films, numbered 5 down to 1.

02

Write a packing list with three bullets, where the item Clothes has its own nested bullet list of Shirts and Socks.

03

Write a description list for a phone: Screen is 6.1 inches, Battery is 4000 mAh.

Explain it without notes

01

When do you use <ul>, <ol> and <dl>?

02

How do you nest a list correctly, and what goes wrong if you don't?

03

What do start, reversed, type and value do?

04

Why should a navigation menu be a list?

All three kinds of list

Preview

Press Run to see the page.

Console

Nothing logged yet.

Expected console output

Top-level steps: 3
All li in the method: 5
Glossary terms: Whisk, Batter