ol
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 left padding for indentation.
Semantic Meaning
An ordered list conveys that:
- The content is a collection of related items
- The order of items is significant
- Rearranging items would change the meaning
- Items have a natural sequence or ranking
Screen readers announce the list, item count, and each item's position, helping users understand the sequential nature of the content.
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
Default
Standard ordered list with decimal numbering.
- First step in the process
- Second step in the process
- Third step in the process
- Fourth step in the process
Numbering Styles
Use the type attribute to change the numbering style.
Uppercase Letters (type="A")
- First item
- Second item
- Third item
Lowercase Letters (type="a")
- First item
- Second item
- Third item
Roman Numerals (type="I")
- First item
- Second item
- Third item
Lowercase Roman Numerals (type="i")
- First item
- Second item
- Third item
| 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 and Reversed
Custom Start Value
Use the start attribute to begin numbering from a specific value.
- This is item 5
- This is item 6
- This is item 7
Reversed Order
Use the reversed attribute for countdown lists.
- Bronze medal
- Silver medal
- Gold medal
Combined Attributes
Combine start, reversed, and type for complex numbering.
- Countdown from X
- Item IX
- Item VIII
Variants
.inline
Display list items horizontally. Numbers are removed in this variant.
- Step 1
- Step 2
- Step 3
- Step 4
.unstyled
Remove numbers and indentation for custom styling.
- First item (no number)
- Second item (no number)
- Third item (no number)
Nested Lists
Ordered lists can be nested to create hierarchical numbered structures.
- Main section one
- Sub-section one
- Sub-section two
- Main section two
- Sub-section one
- Sub-section two
- Sub-section three
- Main section three
Mixed Nesting
Combine ordered and unordered lists for complex content structures.
- Gather ingredients
- Flour
- Sugar
- Eggs
- Mix dry ingredients
- Add wet ingredients
- Bake at 350F
Accessibility
Screen Reader Behavior
- Announced as "list" with item count
- Each item announced with its number and position
- The
reversedattribute is reflected in announced numbers - Custom
startvalues are properly announced
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
typeattribute for legal/academic numbering styles - The
valueattribute on<li>can override individual item numbers
Individual Item Values
Override specific item numbers with the value attribute on <li>.
- Item 1
- Jumps to 5
- Continues from 6
CSS Properties
| Property | Value | Description |
|---|---|---|
padding-inline-start |
var(--size-l) |
Left indentation for list items |
Variant: .inline
| Property | Value |
|---|---|
display |
flex |
flex-wrap |
wrap |
gap |
var(--size-s) |
list-style |
none |
Attributes Summary
| Attribute | Values | Description |
|---|---|---|
type |
1, A, a, I, i |
Numbering style |
start |
Integer | Starting number |
reversed |
Boolean | Count down instead of up |
Related Elements
Patterns Using This Element
The <ol> element serves as the semantic foundation for these patterns:
Timeline
Chronological events, order tracking, and activity feeds