<ol> elementThe <ol> element represents an ordered list. It groups list items where the order of the items is part of the meaning.
This is useful for instructions, rankings, sequences, procedures, recipes, timelines, priority lists, and any list where changing the order would change what the author is saying.
The items inside an <ol> are written with <li> elements. The list element gives the sequence; the list item elements hold the individual steps or entries.
The start attribute sets the starting number as an integer. For example, start="4" begins at 4. The type attribute accepts 1, a, A, i, or I for decimal numbers, lowercase or uppercase letters, or lowercase or uppercase Roman numerals. Even with letters or Roman numerals, start takes an integer: type="A" start="4" begins at D. Use CSS for marker styling when the style is purely visual.
An ordered list should not be chosen just because numbered items look neat. If the sequence does not matter, <ul> is the appropriate choice.
The boolean reversed attribute makes the numbering count down without rearranging the items. When start is omitted, a reversed list starts at the number of its list items; an ordinary list starts at 1. An individual <li> can use value to change its number and the numbering that follows.
The example below continues a procedure at step 4. For a list of substeps, place another list inside the relevant <li>, before its closing tag.
Attributes: reversed, start, type, GLOBALS.
Typical layout: <ol start="4"> <li>Write the HTML.</li> <li>Add the CSS.</li> <li>Test the page.</li> </ol>
Visual representation:
Numbering continues at 4.