The start, reversed and type attributes of the <ol> element control how an html ol numbers its items: start sets the first number, reversed counts down and type picks the numbering style. You can also set the number of a single item with the value attribute on an <li>.
These attributes change the numbers that browsers generate, not the order of the items in your markup. They are part of the HTML living standard and are not deprecated, although CSS offers more control for presentation.
startreversedtypevaluestartBy default an ordered list begins at 1. Set start to an integer to begin elsewhere. The value is always a number, even when the list uses letters or roman numerals.
This is useful when one list is split by a paragraph or an image, and the second part must continue the count. Negative numbers and zero are allowed, so start="0" gives a list that begins at 0.
reversedThe boolean attribute reversed makes the numbers descend. Without start, the count begins at the number of items.
This fits countdown lists such as "top 10" rankings, where you write the items in reading order but want the highest number first. Combine it with start when the first number is not the item count:
The result counts 10, 9. The attribute has no value: write reversed, not reversed="true". Writing reversed="false" still turns it on, because only the presence of a boolean attribute matters.
typeThe type attribute on <ol> selects the marker style.
type value | Marker style | Example |
|---|---|---|
1 (default) | Decimal numbers | 1, 2, 3 |
a | Lowercase letters | a, b, c |
A | Uppercase letters | A, B, C |
i | Lowercase roman numerals | i, ii, iii |
I | Uppercase roman numerals | I, II, III |
Note that start="3" still uses a number, and the browser converts it to the letter C. For <ul> the type attribute is obsolete, but on <ol> it is valid and means "list marker type".
valueAn <li> inside an <ol> accepts a value attribute that sets its own number. The following items continue counting from that value.
Use this sparingly. If you often need to override numbers, a restructured list or CSS counters may be a cleaner solution.
The type attribute only offers five styles. The CSS property list-style-type supports many more, such as lower-greek, decimal-leading-zero and custom counter styles. The HTML attributes also affect the meaning of the numbers (what a screen reader reads), while CSS only changes how they look.
A good rule: use start, reversed and value when the numbers themselves carry information, and use CSS for decoration. If both are set, CSS list-style-type wins over the type attribute for the marker style.
Suppose you show a top ten, but want a paragraph between places 10 to 8 and places 7 to 1. Use two lists and set reversed and start on each one.
Each list is independent, so the second must declare its own starting number. Keeping the numbers in attributes instead of in the text means the markup stays valid and screen readers still read the correct position of each item.
The start and reversed attributes are reflected as DOM properties, which is handy when you build lists dynamically.
reversed reorder the items on the page?No. The items stay in source order. Only the numbers shown next to them count down.
start be a letter?No. start must be an integer. To start a lettered list at C, use type="A" with start="3".
type attribute deprecated on ol?No. It is valid on <ol>, although CSS list-style-type is the more flexible modern way to style markers.
<ul>?No. start, reversed and value only apply to ordered lists. Unordered lists have no numbers to change.
Use start to begin at any integer, reversed to count down and type to pick decimal, letter or roman markers. Use value on an <li> to jump a single item. The attributes change numbering, not item order, and CSS list-style-type gives wider styling options when the numbers are only decoration.