Mark up a recipe with lists

Task

The starter page is a pancake recipe written as plain paragraphs with <br>, dashes and typed-in numbers. Rewrite it with the list type that matches each part: ingredients, numbered steps, a step with sub-steps and a small glossary of cooking terms.

Requirements

  • Ingredients are an unordered list <ul> with at least 4 items
  • Cooking steps are an ordered list <ol> with at least 4 steps
  • One step contains a nested <ul> placed inside its <li>, not directly inside <ol>
  • Serving steps are a second <ol> that continues the numbering with the start attribute
  • The glossary uses <dl> with a <dt> for each term and a <dd> for its meaning (at least 2 terms)
  • The page has one <h1>, and each list has its own <h2> heading
  • No <br>, dashes or typed-in numbers are used to fake list items

Starter code

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Pancakes</title>
</head>
<body>
  <h1>Pancakes</h1>
  <p>
    Ingredients:<br>
    - 2 eggs<br>
    - 250 ml milk<br>
    - 150 g flour<br>
    - 1 tbsp sugar<br>
    - A pinch of salt
  </p>
  <p>
    1. Whisk the eggs with the sugar and salt.<br>
    2. Pour in the milk and stir.<br>
    3. Add the flour: sift it, add it in three parts, whisk until smooth.<br>
    4. Fry each pancake for 1–2 minutes per side.<br>
    5. Stack the pancakes on a plate.<br>
    6. Serve with jam or sour cream.
  </p>
  <p>
    Whisk — to beat quickly until smooth.<br>
    Sift — to pass flour through a sieve to remove lumps.
  </p>
</body>
</html>
▶ Open in HTML Editor

Hints

  • A nested list must live inside an <li>: <li>Add the flour: <ul>…</ul></li>. A <ul> placed directly inside <ol> is invalid HTML.
  • Choose the list by meaning, not by looks: if the order matters (steps), use <ol>; if it doesn't (ingredients), use <ul>.
  • start="5" makes the second list continue from 5 — the browser numbers the items, so don't type the numbers yourself.
  • <dl> is for term–description pairs: each <dt> is followed by the <dd> that explains it.
  • Bullets and numbers come from the list itself, so remove the dashes, the typed numbers and every <br> from the starter text.
Show solution
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Pancakes</title>
</head>
<body>
  <h1>Pancakes</h1>

  <h2>Ingredients</h2>
  <ul>
    <li>2 eggs</li>
    <li>250 ml milk</li>
    <li>150 g flour</li>
    <li>1 tbsp sugar</li>
    <li>A pinch of salt</li>
  </ul>

  <h2>Cooking</h2>
  <ol>
    <li>Whisk the eggs with the sugar and salt.</li>
    <li>Pour in the milk and stir.</li>
    <li>Add the flour:
      <ul>
        <li>sift it;</li>
        <li>add it in three parts;</li>
        <li>whisk until smooth.</li>
      </ul>
    </li>
    <li>Fry each pancake for 1–2 minutes per side.</li>
  </ol>

  <h2>Serving</h2>
  <ol start="5">
    <li>Stack the pancakes on a plate.</li>
    <li>Serve with jam or sour cream.</li>
  </ol>

  <h2>Glossary</h2>
  <dl>
    <dt>Whisk</dt>
    <dd>To beat quickly until smooth.</dd>
    <dt>Sift</dt>
    <dd>To pass flour through a sieve to remove lumps.</dd>
  </dl>
</body>
</html>

Related tools