HTML Ordered List | Structuring Numbered Content

An HTML Ordered List is used to display a list of items in a specific order. The items are numbered by default, making it ideal for steps, rankings, or any content where sequence matters. Ordered lists are created using the <ol> tag, with each item enclosed in <li> (list item) tags.

Types of Ordered Lists:

How to Create an Ordered List:

1. Use the <ol> tag to start the ordered list.
2. Add each item using <li> tags.
3. Close the list with </ol>.

Example of an Ordered List:

The following example demonstrates a simple ordered list with three items:

Code Example

<!DOCTYPE html>
<html>
    <head>
        <title>HTML Ordered List</title>
    </head>
    <body>
        <h1>Steps to Make Tea</h1>
        <ol>
            <li>Boil water.</li>
            <li>Add tea leaves.</li>
            <li>Pour into a cup and enjoy!</li>
        </ol>
    </body>
</html>

Output

Steps to Make Tea

1.Boil water. 2.Add tea leaves. 3.Pour into a cup and enjoy!

Attributes of the <ol> Tag:

Example with Custom Attributes:

This example demonstrates a reversed list starting at 5 with Roman numeral markers:

Code Example

<!DOCTYPE html>
<html>
    <head>
        <title>HTML Ordered List</title>
    </head>
    <body>
    <ol type="I" start="5" reversed>
    <li>Fifth Item</li>
    <li>Fourth Item</li>
    <li>Third Item</li>
</ol>
</body>
</html>

Output

    V.Fifth Item
    IV.Fourth Item
    III.Third Item

Features of Ordered Lists:

HTML Ordered Lists are an essential tool for presenting sequential information clearly. By utilizing attributes like `type`, `start`, and `reversed`, you can create dynamic and flexible lists to suit your content needs.