HTML Tags

HTML <ol> Tag

The <ol> tag in HTML defines an ordered (numbered) list, and the <li> tag defines individual list items within that list.
Ordered lists are used when the sequence of items is important, such as steps in a process, rankings, or instructions.

Syntax

<ol>
  <li>Step 1</li>
  <li>Step 2</li>
  <li>Step 3</li>
</ol>

Attributes

TagAttributeDescription
<ol>typeSpecifies the numbering type. Values: 1 (default), A, a, I, i.
<ol>startDefines the starting number for the list.
<ol>reversedDisplays the list in descending order. (Boolean attribute)
<li>valueSpecifies a custom number or letter for the list item.
<li>typeOverrides the numbering type for that specific item. (Deprecated)

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Ordered List Example</title>
  <style>
    ol {
      background-color: #f9f9f9;
      padding: 15px;
      border: 1px solid #ddd;
      border-radius: 8px;
      width: 250px;
    }
    li {
      margin: 5px 0;
      color: #333;
      font-size: 16px;
    }
  </style>
</head>
<body>
  <h2>Steps to Make Tea</h2>
  <ol type="1" start="1" reversed>
    <li>Boil water</li>
    <li>Add tea leaves</li>
    <li>Pour into cup</li>
    <li>Add sugar and milk</li>
  </ol>
</body>
</html>

Output

Browser Output

Use our TryIt Editor to see the output

Browser Support

Chrome
Chrome
Firefox
Firefox
Edge
Edge
Safari
Safari
Opera
Opera
IE
IE9+
✅Yes✅Yes✅Yes✅Yes✅Yes✅Yes

The <ol> and <li> tags have full browser support across all modern browsers.
Use our Try It Editor to see how list numbering, types, and reversal behave in different browsers.

Notes

  • The <ol> tag is used for ordered lists, and <li> defines the items within it.
  • You can start numbering from any point using the start attribute.
  • The reversed attribute displays lists in reverse order.
  • The numbering style can be customized using CSS:
ol { list-style-type: upper-roman; }
  • Nested ordered lists create hierarchical numbering.

Conclusion

The <ol> and <li> tags are perfect for creating structured, ordered lists where sequence matters.
They make step-by-step guides, rankings, and ordered data clear and easy to follow.
Use attributes like type, start, and reversed to fully control the numbering behavior.

Sign In Form

User your email and password to singn in

Don’t have an account, signup here : 

HTML5 & CSS3

Tools and Tutorials

Want a Website

Want a website for your business ?

Please fill out the details below, so we can reach out to you.

Registration Form

Signup to track your record and much more.

We have sent you an email with a registration link. Please click the link to verify your email address, or enter the 6-digit OTP provided in the email.

Didn't receive the OTP. Regenerate OTP Resend