HTML <ol> (Ordered List) Tag

❮ Previous Reference Next ❯

Example

<ol>
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
</ol>

Meaning

The <ol> element is used to define an ordered or numbered list of items.

The numbering style comes in many forms, including letters, Roman numerals, and regular numerals.

The individual items within the list are specified by <li> elements included with the ol element.

Note: HTML5 returns the start attribute to ordered lists and adds the reversedattribute

Version: HTML 2, 3.2, 4, 4.01, 5


Standard Syntax

<ol>
  <li></li>
</ol>



Browser Support




Status







Attributes

Attribute Value Description
compact compact Deprecated. Specifies that the list should be rendered in a compact style.
reversed reversed Specifies that the counting of the list should go in reverse order.
start number Specifies the start value of an ordered list
type 1
A
a
I
i
Specifies the kind of marker to use in the list



Global Attributes

The <ol> element also supports the Global Attributes in HTML.


Event Attributes

The <ol> element also supports the Event Attributes in HTML.




Live Demonstration:

  1. One
  2. Two
  3. Three




CSS:


  <One>
  <Two>
  <Three>
<ol>



By Default CSS Value(s)

Most of the browsers will display the <ol> element with the following by default value(s)

ol {
  display: block;
  list-style-type: decimal;
  margin-top: 1em;
  margin-bottom: 1em;
  margin-left: 0;
  margin-right: 0;
  padding-left: 40px;
}



Related Tags:

<blockquote>, <dd>, <div>, <dl>, <dt>, <figcaption>, <figure>, <hr>, <li>, <ol>, <p>, <pre> and <ul>
❮ Previous Reference Next ❯