HTML – How to use Ordered Lists

The <ol> HTML element is used to create ordered lists.

For example

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

There are two useful attributes to make the most of ordered list.

Start attribute

The start attribute is used to specify the starting number of the list.

To use the start attribute, simply add the start attribute to the element and set its value to the desired starting number.

For example:

<ol start="4">
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ol>

This will create an ordered list that starts at 4, like this:

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

Reversed attribute

The reversed attribute is used to create a list in reversed order.

To create a reversed order list, simply add the reversed attribute to the element.

For example:

<ol reversed>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>

This will create a reversed ordered list that looks like this:

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

Using start and reversed attributes together

You can also combine the start and reversed attributes to create a reversed ordered list that starts at a specific number.

For example:

<ol start="4" reversed>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>

This will create a reversed ordered list that starts at 4 and looks like this:

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