HTML · Unit 1: Your first web page · Lesson 4 of 5
Lists
<ul> makes an unordered list of bullet points, for when order does not matter.
Opens this lesson in Code Academy. Lessons open one after another, and each unit opens when you pass the checkpoint quiz before it (you can take a checkpoint early to skip ahead). If this lesson is not open yet, the button shows you its unit on your map.
The idea
<ul> makes an unordered list of bullet points, for when order does not matter. <ol> makes an ordered list with numbers, for steps.
Every item goes in its own <li>, and every <li> sits directly inside a <ul> or <ol>.
The browser draws the bullets and numbers for you, so never type them yourself.
Worked example
HTML
<h2>Packing list</h2>
<ul>
<li>Tent</li>
<li>Sleeping bag</li>
</ul>
<h2>Setting up</h2>
<ol>
<li>Find flat ground</li>
<li>Lay out the tent</li>
</ol>
Key terms
- List
- <ul> for bullets, <ol> for numbered steps; each item is an <li>.
Practise it in Code Academy
It has 4 exercises (multiple choice, fill in the blank, fix the broken code and write code from a prompt) and takes about 6 minutes. Every answer is checked as you go, and feedback names the exact mistake. Hints and the solution are there if you get stuck.
Every lesson is free: no ads, no lives and no paywall.