<ol>


HTML <ol> Tag

Instance

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文网(php.cn)</title> 
</head>
<body>

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

<ol start="50">
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>
 
</body>
</html>

Run Example»

Click the "Run Instance" button to view the online instance


Browser support

1000.png

Currently most browsers support < ol> tag.


Tag definition and usage instructions

<ol> The tag defines an ordered list. The sorting of the list is displayed by numbers.

Use the <li> tag to define list options.


Tips and Notes

Tips: If an unordered list is required, use the <ul> tag.

Tip: Use CSS to define the list style.


Differences between HTML 4.01 and HTML5

In HTML 4.01, the "start" and "type" attributes have been deprecated and HTML5 does not support this attribute.

The "reversed" attribute is new in HTML5.

The "compact" attribute has been deprecated in HTML 4.01 and is not supported in HTML5.


Attributes

New: HTML5 new attributes.

AttributesValueDescription
compactcompact Not supported in HTML5 and deprecated. Please use style to replace it. Specifies that the list should be rendered smaller than normal.
reversedNewreversedSpecify the list in reverse order (9,8,7...)
startnumberHTML5 is not supported and is deprecated. Please replace it with a style. Specifies the starting point in the list.
type1
A
a
I
i
Specifies the type of the list. Deprecated. Please use styles instead.


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