ol – ordered list
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
Permitted contents | One of the following: |
---|---|
Permitted parents | Any element that can contain [flow content](/w/index.php?title=html/concepts/flowContent&action=edit&redlink=1). |
Tag omission | A **ol** element must have both a start tag and an end tag. |
Examples
This example uses the ol element to create a numbered list.
<ol>
<li>This is the first list item</li>
<li>This is the second list item</li>
</ol>
The ol element with the type attribute set to a.
<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.
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
- Document Object Model (DOM) Level 2 HTML Specification, Section 1.6.5
- HTML 4.01 Specification, Section 10.2
Related specifications
See also
Other articles
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]