The HTML <ol> type attribute
Quick answer
The HTML type attribute sets the numbering style of an ordered list. It is used on the <ol> element.
Overview
The type attribute sets the marker style of an ordered list. 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 type="A"> … </ol>
Values
| Value |
|---|
| 1 (numbers, default) | a (lowercase letters) | A (uppercase letters) | i (lowercase Roman) | I (uppercase Roman) |
Example
<ol type="A"><li>First</li><li>Second</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 type attribute do?
Sets the marker style of an ordered list.
How do I change where an ordered list starts?
Set the start attribute, e.g.
<ol start="5">.Which elements use the type attribute?
It is an element-specific attribute, used on the
<ol> element.