The <ol>
element
Short for ‘Ordered List’. A list of items whose order is significant, and which the browser will number automatically.
Browser support
The reversed
attribute was added in HTML5.
It's now supported by all modern browsers, except for Internet Explorer.
You can make it work in IE using a JavaScript polyfill.
That code works by finding any <ol>
elements with a reversed
attribute and setting all the numbering explicitly by adding value
attributes to the list's <li>
elements.
Interactive example
Full list of attributes
All the usual HTML global attributes are available
reversed
- If present, numbering will be shown in reverse order. The items themselves will still be displayed in the order they're given in the source; it's only the way the numbers are assigned to them that is reversed.
start
- Numeric value of first item's number. It's given as a decimal number, however the numbers are to be displayed.
type
- What kind of numbering or lettering should be used.