Name
ol — HTML 4.01 | HTML5
Synopsis
<ol> . . . </ol>
Defines an ordered (numbered) list that consists of one or more
list items (li
). The user agent
inserts item numbers automatically.
Start/End Tags
Required/Required
Attributes
Core, Internationalization, Events, HTML5 Global Attributes
compact
(compact="compact"
in XHTML)Deprecated. Not in HTML5. Displays the list as small as possible. Few browsers support the
compact
attribute.reversed
(reversed="reversed"
in XHTML)HTML5 only. Reverses the numbering sequence, from highest to lowest value.
start="
number
"
Deprecated. Included in HTML5. Starts the numbering of the list at
number
instead of at 1.type="1|A|a|I|i"
Deprecated. Not in HTML5. Defines the numbering system for the list as follows:
Type value
Generated style
Sample sequence
1
Arabic numerals (default)
1, 2, 3, 4
A
Uppercase letters
A, B, C, D
a
Lowercase letters
a, b, c, d
I
Uppercase Roman numerals
I, II, III, IV
i
Lowercase Roman numerals
i, ii, iii, iv
Example
<ol> <li>Get out of bed</li> <li>Take a shower</li> <li>Walk the dog</li> </ol>
Get HTML & XHTML Pocket Reference, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.