HTML - <ol> Tag


Advertisements


Description

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

Example

Live Demo
<!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 the following result −

Global Attributes

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

Specific Attributes

The HTML <ol> tag also supports the following additional attributes −

Attribute Value Description
compact autofocus Defines if compact rendering is required.
reversed html-5 reversed Specifies the order of the list (descending).
start html-5 number Specifies 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

Chrome Firefox IE Opera Safari Android
Yes Yes Yes Yes Yes Yes

html_tags_reference.htm

Advertisements