<ol>...</ol>

HTML4 HTML5

Creates an ordered list[cite: 3].

Both opening and closing tags are mandatory[cite: 3].

Example 1

<ol>
  <li>First</li>
  <li>Second</li>
  <li>Third</li>
  <li>Fourth</li>
</ol>

 The browser will interpret this code as follows:

  1. First
  2. Second
  3. Third
  4. Fourth

To define individual list items, we use the <li> tag[cite: 3].

The appearance of an ordered list can be modified using attributes[cite: 3]:

compact - present in HTML4, HTML5 does not support this attribute[cite: 3]. Renders the list with a smaller font - compact list[cite: 3].

reversed - attribute added in HTML5, not present in HTML4[cite: 3]. Numbers the list in descending order[cite: 3].

start="number" - number of the first item in the list[cite: 3].

type="value" - specifies the list numbering type[cite: 3]. The value parameter can take the following designations[cite: 3]:

Example 2

<ol start="5" type="I">
  <li>First</li>
  <li>Second</li>
  <li>Third</li>
  <li>Fourth</li>
</ol>

The browser will interpret this code as follows:

  1. First
  2. Second
  3. Third
  4. Fourth

 

Example 3

<ol start="10" type="a" reversed>
  <li>First</li>
  <li>Second</li>
  <li>Third</li>
  <li>Fourth</li>
</ol>

The browser will interpret this code as follows:

  1. First
  2. Second
  3. Third
  4. Fourth