The WebPlatform project has been discontinued when the Stewards partnership agreement ended in September 2015. This site has been frozen, and the assets we have created will remain.
ol – ordered list
This article is In Progress.
For technical reasons, the title of this article is not the text used to call this API. Instead, use
The ol element is used to define an ordered list. The element encloses one or more list items, enclosed in li elements.
|Permitted contents||One of the following:|
|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.
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;
The type attribute sets the list type for all ensuing lists unless a different type value is set.
- Document Object Model (DOM) Level 2 HTML Specification, Section 1.6.5
- HTML 4.01 Specification, Section 10.2
|HTML 5.1||W3C Working Draft|
|HTML 5||W3C Recommendation|
|HTML 4.01||W3C Recommendation|
This article contains content originally from external sources.
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]