Example

An ordered procedure with meaningful steps

Model a sequence as an ordered list and distinguish the numbered structure from decorative markers.

Beginner2 min readLearn · Practice · Review

Published by HTML Code Runner · AI-assisted material · Independent editorial review pending · Editorial policy

On this page

Understand the source

The recipe is an ordered list because the steps depend on sequence. Each li owns one step, and the browser supplies a marker. The source order matters even if a stylesheet changes the numbering appearance. A collection of paragraphs prefixed with typed digits would not expose the same list structure.

<h1>Make a cup of tea</h1>
<ol>
  <li>Heat fresh water.</li>
  <li>Steep the leaves.</li>
  <li>Pour into a cup.</li>
</ol>

Expected output

Three steps appear in numerical order. The heading introduces the task but is not itself a list item. Add another paragraph inside one li and observe that the whole step still has one marker; a step can contain more than a single line of text.

Make a deliberate change

Add a final step to rinse the teapot, then reconsider whether it belongs at the end or before brewing. Move the actual li in the source. Next add an unordered list of optional flavorings inside the serving step, keeping that sublist within its parent li.

Review the behavior

Read the instructions without the stylesheet and confirm that the sequence still works. Do not place a nested ul between li siblings. For quantities or glossary definitions, consider whether a description list would communicate the relationships more accurately than a procedure.

Read the full explanation and expected output