Ordered Lists: the type and start Attributes
Quick answer An ordered list numbers its items automatically; type changes the style of the marker and start changes the value it counts from.
A list is a set of items shown one below another, each carrying a marker such as a number or a bullet. HTML — HyperText Markup Language — gives you three kinds of list: the ordered list, the unordered list and the description list. This section deals with the first of them.
An ordered list is used when the order of the items carries meaning — the steps of a procedure, the positions in a merit list, the stages of booking a railway ticket. It is written with the container tag <ol> and closed with </ol>. Every item inside it is written with the list item tag <li> ... </li>. You never type the numbers yourself; the browser generates them.
<ol>
<li>Open the IRCTC website</li>
<li>Search for the train</li>
<li>Enter the passenger details</li>
<li>Pay using UPI or a debit card</li>
</ol>This displays as items 1, 2, 3 and 4. Insert a new step in the middle or delete one, and the whole list renumbers itself. That automatic renumbering is the advantage an examiner expects you to state when asked why a list tag is better than typing numbers into a paragraph.
The type attribute changes the style of the marker. It is written inside the opening <ol> tag and applies to every item of that list. Its five values are: 1 for ordinary numbers (this is the default, used when you write no type at all), A for capital letters, a for small letters, I for capital Roman numerals and i for small Roman numerals. The letter values are case sensitive: type="A" produces A, B, C while type="a" produces a, b, c, and type="I" produces I, II, III while type="i" produces i, ii, iii. All five values above are valid; typing one of them in the wrong case simply gives the wrong style of marker, which is a common slip in the exam.
The start attribute tells the browser which value to begin counting from. Its value is always a plain number, even when the markers are letters or Roman numerals. So start="3" means the third marker of whichever style you chose — the numeral 3, the letter C, or the Roman numeral III. This is useful when a long list has been broken by a paragraph of explanation and the second part must carry on from where the first stopped.
<ol type="I" start="4">
<li>Physics practical</li>
<li>Chemistry practical</li>
<li>Computer practical</li>
</ol>Because the style is capital Roman and counting starts at 4, the three items are marked IV, V and VI. Note that start="IV" would be wrong; the number is what the attribute expects.
Two more points that examiners test. First, both attributes go on the opening <ol> tag, not on <li>. Second, an ordered list may hold ordinary text, other tags such as <strong>, images or even another list inside each <li>. A full-mark answer about ordered lists names the tag pair, says that each item is marked with <li>, names the attribute with its permitted values, and shows a two-line or three-line example.
- An ordered list uses <ol> ... </ol> and each item uses <li> ... </li>.
- Use an ordered list only when the sequence of items matters; the browser numbers them automatically.
- type takes 1, A, a, I or i; the default is 1 and the letter values are case sensitive.
- start takes a plain number, so <ol type="A" start="3"> begins at C.
- Both type and start are written in the opening <ol> tag and apply to the whole list.
- Adding or deleting an <li> renumbers the list on its own — the main advantage of list tags.
