Lesson 12 / 28

Lists

Ordered, unordered and description lists.

ul and ol

<ul> gives bullets, <ol> gives numbers; each item is an <li>.

<ul>
  <li>Tea</li>
  <li>Coffee</li>
</ul>

<ol>
  <li>Preheat oven</li>
  <li>Bake for 20 minutes</li>
</ol>

Nested lists

Put a whole <ul> or <ol> inside an <li> to create sub-items.

<ul>
  <li>Fruits
    <ul>
      <li>Apple</li>
      <li>Banana</li>
    </ul>
  </li>
</ul>

Description lists

<dl> pairs terms with definitions using <dt> (term) and <dd> (description) — handy for glossaries.