The HTML reversed attribute
Quick answer
The HTML reversed attribute numbers the list in descending order. It is used on the <ol> element.
Overview
The reversed attribute counts an ordered list downwards. It is used on the <ol> element.
It controls the numbering of an <ol> ordered list: where it starts, which direction it counts, and the marker style. The browser handles the actual numbering for you.
Syntax
<ol reversed> … </ol>
Values
| Value |
|---|
| A boolean attribute: present or absent. |
Example
<ol reversed><li>Third</li><li>Second</li><li>First</li></ol>
Best practices
- Let the browser number the items; never hand-type the numbers.
- Use start and reversed to adjust the sequence instead of faking it.
- Use <ol> only when order is meaningful; otherwise a <ul>.
- Style or hide the markers with the CSS list-style property.
Frequently asked questions
What does the reversed attribute do?
Counts an ordered list downwards.
How do I change where an ordered list starts?
Set the start attribute, e.g.
<ol start="5">.Where does a reversed list start counting?
From the number of items in the list, counting down to 1. Set start to choose the first number yourself.
Which elements use the reversed attribute?
It is an element-specific attribute, used on the
<ol> element.