ol

< html‎ | elements
Jump to: navigation, search

ol – ordered list

This article is In Progress.


ol

For technical reasons, the title of this article is not the text used to call this API. Instead, use ol

Summary

The ol element is used to define an ordered list. The element encloses one or more list items, enclosed in li elements.


Overview Table

DOM Interface HTMLOListElement
Permitted contents One of the following:
  • Either: Zero or more li elements.
  • Or: A template element.
  • Or: any combination of the above two
Permitted parents Any element that can contain flow content.
Tag omission A ol element must have both a start tag and an end tag.

The ordered list, represented by the ol element, is most often used to group a list of items, enclosed in li elements, together in an ordered and semantic way.


Compatibility

Do you think this data can be improved? You can ask to add by opening an issue or make a pull request.

Desktop

FeaturesChromeFirefoxInternet ExplorerOperaSafari
Basic support
1.0
Yes
1.0
Yes
1.0
Yes
1.0
Yes
1.0
Yes
reversed attribute
18
Yes
?
Unknown
?
none
?
none
5.2
Yes

Mobile

FeaturesAndroidFirefox MobileIE MobileOpera MobileSafari Mobile
Basic support
?
Yes
1.0
Yes
?
Yes
?
Yes
?
Yes
reversed attribute
?
Yes
18.0
Yes
?
none
?
none
?
Yes

Examples

View live exampleThis example uses the ol element to create a numbered list.

HTML

<ol>
  <li>This is the first list item</li>
  <li>This is the second list item</li>
</ol>

View live exampleThe ol element with the type attribute set to a.

HTML

<ol type="a">
  <li>This is the first list item</li>
  <li>This is the second list item</li>
</ol>

Typical browser default CSS properties for the ol element.

CSS

display: block;
list-style-type: decimal;
margin-top: 16px;
margin-bottom: 16px;

Notes

Remarks

The type attribute sets the list type for all ensuing lists unless a different type value is set.

Standards information

Related specifications

Specification Status Related Changes
HTML5 W3C Candidate Recommendation

See also

Other articles

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]