HTML <ol> tag

Updated: 11/13/2018 by Computer Hope
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, and related attributes and browser compatibility.


If you wanted to create a bullet list or unordered list, use the <ul> tag.

Example of <ol> code

<h3>Ordered list</h3>
<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>

Each number is created using the <li> tag, which designates a list item.

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


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, and 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.


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

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