👀 Live Preview
Default ordered list with Arabic numerals:
- First item
- Second item
- Third item

The <ol> tag structures ordered lists on webpages. This guide covers syntax, numbering attributes, nested lists, common use cases, and how ol differs from ul.
Sequential numbered content.
Each entry inside list items.
Numbers, letters, Roman numerals.
Control list numbering.
Hierarchical sub-lists.
Ordered vs unordered lists.
<ol> Tag?The <ol> tag is an HTML element used to create ordered lists, where each list item is sequentially numbered or lettered. Understanding how to use this tag is essential for crafting well-organized, step-by-step content.
Every item in an ordered list must be wrapped in an <li> element. Browsers automatically generate markers (1, 2, 3…) based on list attributes and CSS.
To employ the <ol> tag, encapsulate each list item within <li> tags:
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>ol is the container; only li (and script-supporting elements) should be direct children.li, not directly under ol.type, start, or reversed attributes, or CSS list-style-type.| Topic | Code Snippet | Notes |
|---|---|---|
| Basic ol | <ol><li>...</li></ol> | Default 1, 2, 3 |
| Letters | type="A" or type="a" | Upper / lower case |
| Roman | type="I" or type="i" | I, II, III |
| Start at N | start="5" | HTML5 attribute |
| Reverse | reversed | Count downward |
| CSS styling | list-style-type: lower-alpha; | Modern approach |
<ol> vs <ul>| Element | Marker | When to Use |
|---|---|---|
<ol> | Numbers, letters, Roman | Steps, rankings, sequences |
<ul> | Bullets (disc, circle) | Unordered collections |
<li> | Child of both | Individual list item |
ol (ordered)
ul (unordered)
The <ol> tag supports attributes to customize numbering. The most common is type, which specifies the numbering style:
<ol type="1">
<!-- Arabic numerals (default) -->
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
<ol type="A">
<!-- Uppercase letters -->
<li>Item A</li>
<li>Item B</li>
<li>Item C</li>
</ol>
<ol type="a">
<!-- Lowercase letters -->
<li>Item a</li>
<li>Item b</li>
<li>Item c</li>
</ol>
<ol type="I">
<!-- Uppercase Roman numerals -->
<li>Item I</li>
<li>Item II</li>
<li>Item III</li>
</ol>
<ol type="i">
<!-- Lowercase Roman numerals -->
<li>Item i</li>
<li>Item ii</li>
<li>Item iii</li>
</ol>type NumberingValues: 1, A, a, I, i.
type="A"start HTML5Sets the starting number for the first li.
start="5"reversed HTML5Counts list items in descending order.
<ol reversed>value (on li) ItemOverride numbering for a single list item.
<li value="10">For new projects, CSS list-style-type is often preferred over the type attribute for presentation, keeping HTML semantic.
You can nest ordered lists within each other to create a hierarchical structure. Place the nested ol inside a parent li:
<ol>
<li>Main item 1</li>
<li>Main item 2
<ol>
<li>Subitem 2.1</li>
<li>Subitem 2.2</li>
</ol>
</li>
<li>Main item 3</li>
</ol>Real-world ordered lists for tutorials, procedures, and step-by-step instructions.
Default ordered list with Arabic numerals:
Use <ol> for content that follows a specific order or sequence—tutorial steps, ranked lists, and procedural instructions.
Present sequential steps such as a software tutorial or recipe.
<ol>
<li>Open the application.</li>
<li>Select "File" from the menu.</li>
<li>Click "Save."</li>
</ol>Maintain a clear, organized flow when providing assembly or setup instructions.
<ol>
<li>Assemble the components.</li>
<li>Connect the cables.</li>
<li>Power on the device.</li>
</ol>li should be a complete, understandable step or point.li preserve logical hierarchy for assistive tech.Open an ordered list container and add li children.
Numbers or letters appear based on type, start, and CSS.
Visual order and screen reader position convey step sequence.
Readers follow steps and ranked information without confusion.
The <ol> tag is supported in all major browsers including Internet Explorer. No polyfills are needed.
Every browser renders <ol> and <li> with list markers. HTML5 start and reversed are supported in all modern browsers.
Bottom line: Use <ol> confidently for ordered content in any browser.
Mastering the <ol> tag empowers you to structure content in a way that is visually appealing and logically organized. Incorporate ordered lists into your HTML toolkit to create clear, numbered content that enhances the user experience.
<ol>Bookmark these before you build step-by-step content.
Sequential numbered items.
BehaviorEach item in li tags.
Structure1, A, a, I, i markers.
AttributesSub-lists inside li.
HierarchyOrdered vs bullets.
ComparisonAll browsers.
Compatibilityol uses numbers or ordered markers; ul uses bullets.1, A, a, I, and i.ol or ul inside an li element.start="5" on the ol element.Practice <ol> with type attributes and nesting in the Try It editor.
6 people found this page helpful