HTML <ol> Tag

Advertisements


Description

The HTML <ol> tag is used for creating an ordered list.

Example

<!DOCTYPE html>
<html>
<head>
<title>HTML ol Tag</title>
</head>
<body>
<ol>
<li>ol - ordered list</li>
<li>ul - unordered list</li>
<li>dir - directory list</li>
<li>menu - menu list</li>
</ol>
</body>
</html>

This will produce following result:

  1. ol - ordered list
  2. ul - unordered list
  3. dir - directory list
  4. menu - menu list

Global Attributes

This tag supports all the global attributes described in - HTML Attribute Reference

Specific Attributes

The HTML <ol> tag also supports following additional attributes:

AttributeValueDescription
compact autofocusDefines if compact rendering is required.
reversed html-5reversedSpecifies the order of the list (descending).
start html-5numberSpecifies the initial number to start the list.
type A
a
I
i
1
Specifies the style of the list.

Event Attributes

This tag supports all the event attributes described in - HTML Events Reference

Browser Support

ChromeFirefoxIEOperaSafariAndroid
YesYesYesYesYesYes

html_tags_reference.htm