English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
HTML <ol> tag defines an ordered list in the HTML document. This tag is also commonly referred to as the <ol> element.
2 different ordered list examples:
<!doctype html> <html> <head> <meta charset="UTF-8"> <title>HTML ol tag usage (Basic Tutorial Website oldtoolbag.com)</title> </head> <body> <ol> <li>First item</li> <li>Second item</li> <li>Third item</li> <li>Fourth item</li> </ol> <ol start="10"> <li>First item10</li> <li>Second item11</li> <li>Third item12</li> <li>Fourth item13</li> </ol> </body> </html>Test and see ‹/›
IEFirefoxOperaChromeSafari
Most web browsers support the <ol> tag at present.
The <ol> tag defines an ordered list. The list is sorted to display numbers.
The <ol> tag is composed of<li>tags make up.
Use the <ol> tag when the list items have a meaningful numerical order.
You can nest <ol>, <ul>, and <menu> lists.
Tip: If you need an unordered list, please use <ul> tag.
Tip:Use CSS to define list styles.
in HTML 4.01 The "start" and "type" attributes have been deprecated, HTML5does not support this attribute.
"reversed" attribute is not supported in HTML5 .
in the new attribute of 4.01"compact" attribute has been deprecated, in HTML5does not support this attribute.
Attribute | Value | Description |
---|---|---|
compact | compact | HTML5is not supported, not recommended. Use styles instead. Specifies that the list is presented in a more compact manner than the normal case. |
reversedHTML5 | reversed | Specify the reverse order of the list (9,8,7...) |
start | number | HTML5Not supported, not recommended. Use styles instead. Specifies the starting point in the list. |
type | 1 A a I i | Specifies the type of the list. Not recommended. Use styles instead. |
<ol> tag supports global attributes, see the complete attribute table HTML Global Attributes.
<ol> tag supports all HTML Event Attributes.
HTML Tutorial:HTML List