HTML has two main kinds of list.
An unordered list (<ul>) is for items where the order does not matter. Browsers show a bullet before each one:
<ul>
<li>Milk</li>
<li>Eggs</li>
<li>Bread</li>
</ul>
An ordered list (<ol>) is for steps or rankings. Browsers number the items for you:
<ol>
<li>Boil the water.</li>
<li>Add the pasta.</li>
<li>Cook for ten minutes.</li>
</ol>
In both, every item goes in its own <li> (list item) element, and the <li> elements go inside the list. If you add a step in the middle of an ordered list, the numbers update by themselves.
Indenting
The <li> lines above are moved in by two spaces. The browser does not care, but indenting makes it easy to see what is inside what. It is a habit worth building early.
Your Task
- Under "Ingredients", make an unordered list with at least three items.
- Under "Steps", make an ordered list with at least three steps.
- There is a
<ul>with at least three<li>items - There is an
<ol>with at least three<li>items - The bulleted list comes before the "Steps" heading and the numbered list after it
Lesson complete!
Next Lesson: The Structure of a Page