HTML <ol> tag

Updated: 10/11/2017 by Computer Hope

HTML ol tagWhen 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.

Example code

<h3>Ordered List</h3>
<ol>
<li>First numbered item</li>
<li>Second numbered item</li>
<li>Third numbered item</li>
</ol>
<h3>Start at number 5</h3>
<ol start="5">
<li>Fifth numbered item</li>
<li>Sixth numbered item</li>
<li>Seventh numbered item</li>
</ol>

Example result

Ordered List

  1. First numbered item
  2. Second numbered item
  3. Third numbered item

Start at number 5

  1. Fifth numbered item
  2. Sixth numbered item
  3. Seventh numbered item

Attributes

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.

Attribute Description
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

Deprecated attributes

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.

Attribute Description
compact Designates that the list should appear smaller

Compatibility

Internet Explorer Firefox Safari Opera Chrome
All versions All versions All version All versions All versions

Browser, Compatibility, HTML li tag, HTML ul tag, List, Web design terms