HTML <ol> Attributes

HTML <ol> compact Attribute

Use of the compact attribute in an ordered HTML list:

<ol compact>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>

Try it Yourself »


Definition and Usage

The compact attribute is a boolean attribute.

When present, it specifies that the list should render smaller than normal, by reducing the space between lines and the indentation of the list.

HTML <ol> reversed Attribute

Descending list order:

<ol reversed>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>

Try it Yourself »


Definition and Usage

The reversed attribute is a boolean attribute.

When present, it specifies that the list order should be descending (9,8,7…), instead of ascending (1, 2, 3…).

HTML <ol> start Attribute

An ordered list starting at “50”:

<ol start=”50″>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>

Try it Yourself »


Definition and Usage

The start attribute specifies the start value of the first list item in an ordered list.

HTML <ol> type Attribute

An ordered list with uppercase roman numbers:

<ol type=”I”>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>

Try it Yourself »


Definition and Usage

The type attribute specifies the kind of marker to use in the list (letters or numbers).