reversed

Control ordered list numbering direction and start value. Covers reversed, start, and value attributes on ol and li elements.

Overview

The reversed attribute on <ol> reverses the numbering direction so the list counts down instead of up. Combined with start (on <ol>) and value (on <li>), you have full control over ordered list numbering.

Applies to:

  • reversed<ol> only
  • start<ol> only
  • value<li> within an <ol>

Values

AttributeElementValueEffect
reversed<ol>Boolean (no value)Numbers count down from the total number of items
start<ol>IntegerSets the starting number for the first item
value<li>IntegerOverrides the counter for that specific item; subsequent items continue from this value

Reversed Lists

A reversed list counts down from the number of items. A list with 5 items numbers them 5, 4, 3, 2, 1.

Custom Start Value

The start attribute sets the first number. This is useful when a list is split across sections and the second part should continue the numbering.

Combined: Countdown from a Number

Use reversed and start together for top-N countdown lists. Set start to the highest number you want.

Overriding Individual Items

The value attribute on a <li> overrides the counter for that item. Subsequent items continue incrementing (or decrementing, if reversed) from the new value.

List Style Types

The reversed and start attributes work with any list-style-type — Roman numerals, letters, and other numbering systems all reverse correctly.

Accessibility

  • Screen readers announce the list item numbers correctly, regardless of reversed or start values.
  • The semantic ordering is communicated to assistive technology — a reversed list is read in its visual order (top to bottom), with the descending numbers.
  • Do not use CSS counter-reset/counter-increment to fake reversed numbering — it does not communicate the correct semantics to assistive technology.

Limitations

  • The reversed attribute only applies to <ol>. It has no effect on <ul>.
  • The start attribute accepts only integers. It does not accept Roman numerals or letters even when list-style-type uses them.
  • When reversed is used without start, the count begins at the total number of <li> elements. Dynamically adding items changes the starting number, which can be unexpected.
  • The value attribute on <li> resets the counter, which affects all subsequent items. There is no way to override a single item without affecting the ones after it.

See Also

  • <ol> — the ordered list element
  • <li> — list item element
  • <ul> — unordered list element