Lists

HTML <ol> Tag

The <ol> tag defines an ordered list. An ordered list can be numerical or alphabetical.

Definition and Usage

The <ol> tag defines an ordered list. An ordered list can be numerical or alphabetical.

Standard Syntax:<ol>...</ol>

Interactive ExampleRunnable

HTML <ol> Example

html
Try it Yourself
Live code demonstration for the <ol> tag. Click "Try it Yourself" to edit and experiment in real time.
<div style="font-family: system-ui, sans-serif; padding: 16px; background: #ffffff; border-radius: 8px; border: 1px solid #e2e8f0; color: #0f172a;">
<ol>

  
 <li>Coffee</li>

  
 <li>Tea</li>

  
 <li>Milk</li>

 </ol>

 

 <ol start="50">

  
 <li>Coffee</li>

  
 <li>Tea</li>

  
 <li>Milk</li>

 </ol>
</div>

Attributes for <ol>

3 Supported Attributes
AttributeValuesDefaultDescription
reversedreversednoneSpecifies that the list order should be reversed (9,8,7...)
startnumbernoneSpecifies the start value of an ordered list
type1 A a I inoneSpecifies the kind of marker to use in the list
Global Attributes

The <ol> tag also supports the standard global attributes in HTML, including class, id, style, title, hidden, and data-*.

HTML Global Attributes Reference →
Event Attributes

The <ol> tag supports event attributes in HTML, such as onclick, onmouseover, onfocus, and more.

HTML Event Attributes Reference →

Browser Compatibility

ChromeEdgeFirefoxSafariOpera

More Tags in Lists

View All 123Tags →