html · level 1 · unit 4 · lesson 2
- meet it
- guess first
- your turn
- fix it
- nailed it
Tap a green word if you get lost.
meet it
<ol> numbers the items for you.
Some lists need an order, like the steps in a recipe. Use <ol>, short for . The items are still <li>, but they get numbers instead of bullets.
The browser does the counting. Add, remove or swap an item and the numbers update themselves, so never type them in.
Ask yourself: would swapping two items change the meaning? If yes, use <ol>. If not, use <ul>.
<h2>Omelette</h2>
<ol>
<li>Crack the eggs</li>
<li>Whisk them</li>
<li>Pour into the pan</li>
</ol> Press show my page to see it here.
A shopping list can go in any order, so it stays a <ul>.
guess first
The numbers are typed in too. What will you see?
Guess before you run it. Wrong guesses are how you learn, and nothing is marked.
<ol>
<li>1. Mix</li>
<li>2. Bake</li>
</ol>
your turn
Your turn. Teach someone to make tea.
Fill in the list tags on lines 2 and 5 so the steps get numbers. Then add at least two more steps on line 4.
Press show my page to see it here.
- there are three or more numbered stepsnot checked yet
- there is no bullet listnot checked yet
fix it
The toast steps have bullets. Can you fix it?
Press show my page to see it here.
- the three steps are numberednot checked yet
- there are no bullet pointsnot checked yet
- Does the order of these steps matter?
- Steps that must happen in order belong in a numbered list.
- Change
<ul>to<ol>and</ul>to</ol>, then press run.
nailed it
your lists can count now. :D
<ol>numbers its items for you.- Use
<ol>when order matters,<ul>when it does not. - Never type the numbers yourself.
new words in your collection
- ordered list
This lesson isn’t saved. A free account remembers every lesson you finish.