HTML <ol> Tag
Description
The <ol>
HTML element sets up a numbered list. Each list item must begin with <li>
. If a stylesheet is applied to <ol>
, then the <li>
elements inherit these properties.
Properties
- Permitted Parents
- Any element that accepts flow content
- Content
- One or more <li> elements
- Start/End Tags
- Start tag: required, End tag: required
Example
<ol>
<li>Mouse</li>
<li>Cat</li>
<li>Dog</li>
</ol>
Attributes
Attribute | Definition |
---|---|
compact | Renders the list in a more compact way. |
reversed | Specifies that the list order should be descending (9,8,7...) |
start | Specifies what number to start numbering from. |
type | Specifies the type of bullet. Possible values:
|
Global Attributes
The <ol>
tag also supports the Global Attributes in HTML5
Event Attributes
The <ol>
tag also supports the Event Attributes in HTML5
Browser Support
Desktop | |||||
Yes | 12 | Yes | 1 | Yes | Yes |
Tablets / Mobile | |||||
![]() |
|||||
Yes | Yes | 4 | Yes | Yes | Yes |
Last updated by CSSPortal on: 6th December 2019