The HTML <ol> tag is used for creating an ordered list. You can try to run the following code to create an ordered list using the <ol> tag −
The HTML <ol> tag supports the following additional attributes −
Attribute | Value | Description |
---|---|---|
compact | autofocus | Defines if compact rendering is required. |
reversed ![]() | reversed | Specifies the order of the list (descending). |
start ![]() | number | Specifies the initial number to start the list. |
type | A a I i 1 | Specifies the style of the list. |
Example
You can try to run the following code to create an ordered list using the <ol> tag −
<!DOCTYPE html> <html> <head> <title>HTML ol Tag</title> </head> <body> <p>Programming Languages:</p> <ol> <li>Java</li> <li>C++</li> <li>C</li> </ol> </body> </html>