HTML Basics · Lesson 6 of 11

Lists

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

  1. Under "Ingredients", make an unordered list with at least three items.
  2. 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