HTML Ordered Lists
In this page:
<ol type="1" start="number">
<li>Item</li>
<li>Item</li>
</ol>
Creating a Basic Ordered List
<ol> works exactly like <ul> structurally -- items are still wrapped in <li> -- but the browser automatically numbers each item 1, 2, 3, and so on, which is ideal for content where the sequence itself carries meaning, like a recipe's steps.
- Never manually type numbers into ordered list items; let the browser generate them so reordering items stays effortless.
- Accepted attributes:
- type — 1 | a | A | i | I
- start — integer
- reversed — boolean
- li value — integer
Example: Creating a Basic Ordered List
<ol>
<li>Preheat oven</li>
<li>Mix ingredients</li>
</ol>
Choosing a Numbering Style with type
The type attribute changes the marker style from plain numbers to uppercase letters (A), lowercase letters (a), uppercase roman numerals (I), or lowercase roman numerals (i), which is commonly used for formal or legal-style multi-level outlines.
- Combine different type values across nested ordered lists to build a classic formal outline (I, A, 1, a) structure.
- Accepted values:
- 1 — decimal (default)
- a — lowercase letters
- A — uppercase letters
- i — lowercase Roman numerals
- I — uppercase Roman numerals
Example: Choosing a Numbering Style with type
<ol type="I">
<li>First section</li>
<li>Second section</li>
</ol>
Starting from a Custom Number with start
The start attribute sets the number the list begins counting from instead of the default 1, which is useful when continuing a numbered sequence that was interrupted by other content, like a paragraph of explanation between step 3 and step 4.
- Use start to resume a numbered sequence after inserting explanatory content between two separate ol blocks.
- Accepted values:
- start — integer, may be zero or negative
- Applies to ol only
Example: Starting from a Custom Number with start
<ol start="4">
<li>Step four</li>
<li>Step five</li>
</ol>
Counting Down with reversed
The reversed attribute makes the browser count down instead of up, showing the highest number first and counting down to 1, which is a natural fit for countdowns, top-10 style rankings presented from lowest to highest importance, or leaderboard displays.
- Combine reversed with start to control both the counting direction and the exact number the countdown begins at.
- Accepted values:
- reversed — boolean attribute
- Counts from the item count down to 1 (or start)
Example: Counting Down with reversed
<ol reversed>
<li>Third</li>
<li>Second</li>
<li>First</li>
</ol>
Overriding a Single Item Number with value
The value attribute on an individual <li> inside an <ol> overrides just that item's number, and every subsequent item continues counting up (or down, if reversed) from that new value, which is useful for skipping a removed step without renumbering the whole list by hand.
- Use value on a single li to jump the sequence forward when a step was intentionally removed, rather than manually retyping every following number.
- Accepted values:
- value — integer on li within ol
- Following items continue from that number
Example: Overriding a Single Item Number with value
<ol>
<li>Step one</li>
<li value="5">Step five</li>
<li>Step six</li>
</ol>
- Manually typing numbers inside each <li> instead of letting the browser generate them automatically via <ol>, which breaks if items are ever reordered.
- Forgetting that the start attribute is a number, not a letter, even when type is set to a letter or roman numeral style.
- Using reversed without realizing it also requires start (or relies on the item count) to know exactly where the countdown should begin.
- <ol> automatically numbers its <li> items in order, unlike <ul> which uses bullets.
- The type attribute switches the numbering style (1, A, a, I, i), and start sets the first number in the sequence.
- The reversed attribute counts the list down instead of up, and value on an individual li can override its specific number.
<ol> and all its attributes (type, start, reversed) are supported in every modern browser.
Chapter Quiz — Complete all 26 topics to unlock
0/26 topics done
Complete these topics first:
- HTML Favicon
- HTML Page Title
- HTML Tables
- HTML Lists
- HTML Block & Inline
- HTML Comments
- HTML Colors
- HTML CSS
- HTML Links
- HTML Images
- HTML RGB Colors
- HTML HEX Colors
- HTML HSL Colors
- HTML Link Colors
- HTML Link Bookmarks
- HTML Background Images
- HTML Table Borders
- HTML Table Sizes
- HTML Table Headers
- HTML Table Padding & Spacing
- HTML Colspan & Rowspan
- HTML Table Styling
- HTML Table Colgroup
- HTML Unordered Lists
- HTML Ordered Lists
- HTML Other Lists / Description Lists