The ordered list element represents a collection of items where the sequence is meaningful.
Description
The <ol> element creates a numbered list of items. Each item is wrapped in an <li> element. Use ordered lists when the sequence of items matters — such as steps in a process, rankings, or any content where position is significant.
By default, items are numbered with decimal numerals (1, 2, 3...) and have start-side padding (left in left-to-right text, right in right-to-left) for indentation. The numbers sit in that padding, so lists that will carry long markers get a wider indent automatically — see Long markers and other scripts.
When to Use
- Step-by-step instructions or tutorials
- Recipes with sequential steps
- Rankings or leaderboards
- Table of contents
- Legal document sections
- Any content where position matters
When Not to Use
- For unordered collections — use
<ul>
- For term-definition pairs — use
<dl>
- For groups of action buttons — use
<menu>
- For tabular data — use
<table>
Default
Standard ordered list with decimal numbering.
123456
<ol> <li>First step in the process</li> <li>Second step in the process</li> <li>Third step in the process</li> <li>Fourth step in the process</li></ol>
Numbering Styles
Use the type attribute to change the numbering style. It accepts only the five values below; other counter styles (Arabic-Indic, CJK, Hebrew, Greek…) come from the CSS list-style-type property.
| Type Value |
Numbering Style |
Example |
1 (default) |
Decimal numbers |
1, 2, 3... |
A |
Uppercase letters |
A, B, C... |
a |
Lowercase letters |
a, b, c... |
I |
Uppercase Roman |
I, II, III... |
i |
Lowercase Roman |
i, ii, iii... |
Start, Reversed, and Value
Control numbering with the start, reversed, and value attributes.
12345
<ol> <li>Item 1</li> <li value="5">Jumps to 5</li> <li>Continues from 6</li></ol>
In a reversed list without start, counting begins at the number of items, so the last item is 1. A value on an <li> resets the count from that item on (see <li>).
| Attribute |
Values |
Description |
type |
1, A, a, I, i |
Numbering style |
start |
Integer |
Starting number |
reversed |
Boolean |
Count down instead of up |
value (on <li>) |
Integer |
Override a specific item's number |
Variants
.inline
Display list items horizontally. Numbers are removed in this variant — the order is still exposed to assistive technology, but sighted readers lose it, so keep the sequence evident from the content (or use nav.steps for a progress indicator).
.unstyled
Remove numbers and indentation for custom styling.
.meta
A compact inline list with separators between items, shared with <ul>. data-separator="pipe|dash|slash" works on <ol class="meta"> too.
123456
<ol class="inline"> <li>Step 1</li> <li>Step 2</li> <li>Step 3</li> <li>Step 4</li></ol>
12345
<ol class="unstyled"> <li>First item (no number)</li> <li>Second item (no number)</li> <li>Third item (no number)</li></ol>
Nested Lists
Ordered lists can be nested, and can mix with unordered lists for complex hierarchical content. Each nested <ol> restarts at 1 and uses decimal numbers at every depth (browsers do not vary the style by level the way they do for bullets), so set type on the inner list to tell the levels apart.
123456789
<ol> <li>Prepare the workspace <ol type="a"> <li>Clear the bench</li> <li>Lay out the tools</li> </ol> </li> <li>Start the build</li></ol>
123456789101112
<ol> <li>Gather ingredients <ul> <li>Flour</li> <li>Sugar</li> <li>Eggs</li> </ul> </li> <li>Mix dry ingredients</li> <li>Add wet ingredients</li> <li>Bake at 350°F</li></ol>
Long Markers and Other Scripts
List markers sit outside each item, in the list's inline-start padding (the right side in right-to-left text). VB's default indent fits one- and two-digit numbers. CSS cannot measure a marker, so VB widens the indent to 2.5em for the lists it can tell will carry longer ones: roman numerals (type="i" or type="I"), any start, reversed, an <li value>, 27 or more lettered items and 100 or more items.
For anything wider — a large start, CJK counter styles with full-width punctuation, long Arabic-Indic counts — set --ol-indent on the list. Script-specific counters come from CSS list-style-type; markers mirror to the right automatically under dir="rtl".
12
ol:lang(ar) { list-style-type: arabic-indic; }ol:lang(zh) { list-style-type: cjk-decimal; --ol-indent: 3em; }
Accessibility
Screen Reader Behavior
- Announced as a list with its item count
- Items are announced by position (“2 of 4”). That position always counts from 1 —
start, reversed and value change only the marker text
- Chromium and Firefox expose the marker text with the item, so screen readers on those browsers usually read the visible number too; Safari/VoiceOver does not reliably read it. If the actual number matters (a numbered clause, a countdown), say it in the item text as well
Safari / VoiceOver
The .inline, .unstyled and .meta classes remove the markers with list-style: none, and Safari with VoiceOver may then stop announcing the element as a list. Add role="list" where the list structure matters:
12345
<ol class="inline" role="list"> <li>Plan</li> <li>Build</li> <li>Ship</li></ol>
Best Practices
- Use ordered lists only when sequence matters
- Keep step counts reasonable (avoid 50+ step lists)
- Consider breaking very long lists into sections
- Use
type attribute for legal/academic numbering styles
CSS Properties
| Property |
Value |
Description |
padding-inline-start |
var(--ol-indent, var(--size-l)) |
Start-side indentation; the markers sit in it |
padding-inline-start (roman, start, reversed, li[value], 27+ letters, 100+ items) |
var(--ol-indent, 2.5em) |
Wider indent for long markers |
Custom Properties
| Property |
Default |
Description |
--ol-indent |
unset |
Explicit indent for one list; overrides both defaults above |
Variant: .inline
| Property |
Value |
display |
flex |
flex-wrap |
wrap |
gap |
var(--size-s) |
list-style |
none |
Related
<ul> — Unordered list for non-sequential items
<li> — List item element (required child)
<dl> — Definition list for term-description pairs
<menu> — Semantic container for action button groups
article[data-numbered] — Outline numbering (1., 1.1.) for headings, figures and tables
reversed — Reversed, start, value and type for list numbering