Latest web development tutorials

HTML <ol> tag

Examples

Two different ordered list of examples:

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

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

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Most browsers support <ol> tag.


Tag definitions and instructions

<Ol> tag defines an ordered list of numbers to sort the list displayed.

Use the <li> tag to define a list of options.


Tips and Notes

Tip: If youneed an unordered list, use the <ul> tag.

Tip: to define the list of styles using CSS.


HTML 4.01 and HTML5 differences in

In HTML 4.01 "start" and "type" property has been abandoned, HTML5 does not support this property.

"Reversed" attribute is new in HTML5 attributes.

In HTML 4.01 "compact" property has been abandoned, the property is not supported in HTML5.


Attributes

New: HTML5 new property.

属性 描述
compact compact HTML5中不支持,不赞成使用。请使用样式取代它。 规定列表呈现的效果比正常情况更小巧。
reversed New reversed 指定列表倒序(9,8,7...)
start number HTML5不支持,不赞成使用。请使用样式取代它。 规定列表中的起始点。
type 1
A
a
I
i
规定列表的类型。不赞成使用。请使用样式代替。


Global Properties

<ol> tag supports the global attributes, view complete the property sheet HTML Global Attributes .


Event Properties

<ol> tag supports all HTML event attributes .


related articles

HTML Tutorial: HTML list