English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag Directory

HTML: <ol> tag

HTML <ol> tag defines an ordered list in the HTML document. This tag is also commonly referred to as the <ol> element.

Online Examples

2 different ordered list examples:

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML ol tag usage (Basic Tutorial Website oldtoolbag.com)</title>
</head>
<body>
<ol>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
  <li>Fourth item</li>
</ol>
<ol start="10">
  <li>First item10</li>
  <li>Second item11</li>
  <li>Third item12</li>
  <li>Fourth item13</li>
</ol>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Most web browsers support the <ol> tag at present.

Definition and Usage

The <ol> tag defines an ordered list. The list is sorted to display numbers.

The <ol> tag is composed of<li>tags make up.

Use the <ol> tag when the list items have a meaningful numerical order.

You can nest <ol>, <ul>, and <menu> lists.

Tips and Notes

Tip: If you need an unordered list, please use <ul> tag.

Tip:Use CSS to define list styles.

HTML 4.01 with HTML5differences

in HTML 4.01 The "start" and "type" attributes have been deprecated, HTML5does not support this attribute.

"reversed" attribute is not supported in HTML5 .

in the new attribute of 4.01"compact" attribute has been deprecated, in HTML5does not support this attribute.

Attribute

AttributeValueDescription
compactcompactHTML5is not supported, not recommended. Use styles instead. Specifies that the list is presented in a more compact manner than the normal case.
reversedHTML5reversedSpecify the reverse order of the list (9,8,7...)
startnumberHTML5Not supported, not recommended. Use styles instead. Specifies the starting point in the list.
type1
A
a
I
i

Specifies the type of the list. Not recommended. Use styles instead.
Character value, indicating the numbering style of the list. It can be any of the following values:
a-represents lowercase
A-represents uppercase
i-represents lowercase Roman numerals
I-represents uppercase Roman numerals
1-represents numbers

Global Attributes

<ol> tag supports global attributes, see the complete attribute table HTML Global Attributes.

event attributes

<ol> tag supports all HTML Event Attributes.

Related Articles

HTML Tutorial:HTML List