HTML <ol> tag
When writing in HTML, the <ol> tag is a block element used to designate an ordered list. It is useful for creating lists that are either numbered or alphabetical. The following sections contain information about the <ol> tag, including an example of it in use, as well as related attributes and browser compatibility.
<h3>Ordered List</h3> <ol>
<li>First numbered item</li>
<li>Second numbered item</li>
<li>Third numbered item</li>
<h3>Start at number 5</h3> <ol start="5">
<li>Fifth numbered item</li>
<li>Sixth numbered item</li>
<li>Seventh numbered item</li>
- First numbered item
- Second numbered item
- Third numbered item
Start at number 5
- Fifth numbered item
- Sixth numbered item
- Seventh numbered item
Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows the current unique HTML attributes for the <ol> tag, as well as a description of each.
|reversed||Designates that a list should go in descending order|
|start||Designates the start value of an ordered list|
|type||Designates the type of markers to use in a list|
A deprecated attribute is one that may function currently but is not supported in going forward. While the attribute may work with the current version of HTML, it will eventually be phased out. It is better to avoid using these attributes to help future-proof your website.
|compact||Designates that the list should appear smaller|
|All versions||All versions||All version||All versions||All versions|