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.

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.

Numbering Styles

Use the type attribute to change the numbering style.

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.

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.

.unstyled

Remove numbers and indentation for custom styling.

Nested Lists

Ordered lists can be nested, and can mix with unordered lists for complex hierarchical content.

Accessibility

Screen Reader Behavior

  • Announced as "list" with item count
  • Each item announced with its number and position
  • The reversed attribute is reflected in announced numbers
  • Custom start values 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 type attribute for legal/academic numbering styles

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

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

Patterns Using This Element

The <ol> element serves as the semantic foundation for these patterns:

Timeline

Chronological events, order tracking, and activity feeds