<ol>
Example
<p>1. Preheat the oven</p>
<p>2. Mix the dough</p>
<p>3. Bake</p><ol>
<li>Preheat the oven</li>
<li>Mix the dough</li>
<li>Bake</li>
</ol><ol> numbers items automatically and tells screen readers how many steps there are.
Common mistakes
- Typing '1.' and '2.' into paragraphs instead of using
<ol>. - Hiding numbers with CSS for a list where order matters to the reader.
Key points
- Numbers come from
<ol>, not typed into the item text. - A list that continues elsewhere uses
start, not manual numbering. - Only
<li>elements are direct children of the<ol>.
Interview questions
How do I start an ordered list at 5?
Add start="5" to the <ol>. To change one item's number, set value on that <li>.
How do I make a countdown list?
Add the reversed attribute to the <ol>, and the numbers count down from the item count or from start.
How do I use letters or roman numerals?
Use type="a", type="A", type="i" or type="I" on the <ol>, or set list-style-type in CSS.