Group items into bulleted and numbered lists, keep every item inside its list, and put a list inside an item.
Menus, playlists, search results and recipes are all lists of items.
A lot of text is a list: things to bring, events in order, steps to follow. Lists use tags inside tags, just like <strong> inside <p>.
Make your prediction first. Help opens once you've locked it in.
<h2>What to bring</h2>
<ul>
<li>Hat</li>
<li>Water</li>
<li>Sunscreen</li>
</ul>
<ul> makes a list and <li> is one item in it. Read the code. What does the page show under the heading?
Compare the page with your prediction. Then change <ul> and </ul> to <ol> and </ol>: the bullets become numbers. Add one more <li> to the numbered list and watch the numbers update by themselves.
| Code | What it does | Why |
|---|---|---|
<ul> … </ul> |
Makes a list with bullets | ul is an unordered list: the order of the items does not matter |
<ol> … </ol> |
Makes a numbered list | ol is an ordered list. The browser does the counting, so add or move an item and the numbers follow |
<li>Hat</li> |
One item in a list | Every <li> belongs inside a <ul> or an <ol>. Outside one it has no list to belong to and sits in the wrong place |
<li>Relay <ul> … </ul></li> |
A list inside an item | An item is a box like any other, so a whole list can go inside it. The small list closes before </li>, as with any nesting |
the spaces before <li> |
Make the code easier to read | The browser ignores them. The indent is for you, to see which box each line is in |
<h1>Sports day</h1>
<h2>What to bring</h2>
<ul>
<li>Hat</li>
<li>Water</li>
</ul>
<h2>Events</h2>
<ol>
<li>Sprint</li>
<li>Relay</li>
<li>Long jump</li>
</ol>
Put the scrambled lines in order.
This list has a problem.
An item is a box, so another list can sit inside it.

Put the lines in order to make a numbered list of three events. One line is not needed.
Long jump should be number 3 in the list, but it shows a dot and sits further left. Click the line that causes it.
Add Long jump as the third event.
Copy a whole <li> line, then change its words.

Under a new heading, What to bring, add a bulleted list: hat and water.
A bulleted list starts with <ul> and ends with </ul>.
Put an <h2> heading above the list, then one <li> for each thing to bring.

Inside the Relay item, add a bulleted list of two houses: Owls and Hawks.
Put the small list inside the Relay item, before its </li>.
Open <ul>, add one <li> for each house, then close </ul>.

Add a bulleted list of things to bring.
This ticks when your page has all of the above.
Put a list of houses inside the Relay item.
This ticks when your page has all of the above.
Work out the answer before you open the playground.
<style>
li {
color: navy;
font-size: 20px;
}
</style>
<h2>Events</h2>
<ol>
<li>Sprint</li>
<li>Relay
<ul>
<li>Owls</li>
<li>Hawks</li>
</ul>
</li>
<li>Long jump</li>
</ol>
<p>The winner gets a medal.</p>
How many lines of text turn navy and 20px?
Make a page with your top 5 (books, games, places, songs): a title, a numbered list of five items, and a smaller bulleted list inside one item, for example the reasons you picked it.
Start with an <h1> title, then <ol> and five <li> lines.
Pick one item and put a smaller <ul> inside it, before its </li>: the book it was written after, or the best game on the level.
Turn on Boxes: the small list should sit inside one item's box.

Write a top 5 list with a title and a smaller list inside one item.
This ticks when your page has all of the above.
Students make bulleted and numbered lists, keep every item inside its list, and put a list inside an item. About 45 minutes.
Open the teacher guide: answers, solutions, slides and a worksheet.
Read the unit primer "Lists, links and pictures in 5 minutes" first, then do the Make task yourself.
The idea: a list is a box of items. <ul> gives bullets, <ol> gives numbers, and every <li> must sit inside one. An item is a box too, so another list can go inside it, which is nesting from the second lesson.
Turn on Boxes in the playground: it shows each item inside its list.
Keeping every li inside its list. Turn on Boxes and ask which box each item sits in, rather than moving the tag for them.
Stretch: Put a list inside a list inside a list. What does the browser do to the bullets at each level? Then write an li rule that makes every item a different colour from its heading.
Support: Give students the Modify starter and do the first task together. Point at Boxes to show the new item's box inside the list.
Next lesson makes the items in a list into links, with a new idea: an attribute inside the opening tag. Class idea: write the steps to make toast as an ordered list, then swap and follow a partner's list.