Course Content
About Lesson

In HTML, an ordered list is a way to represent a list of items in a specific order or sequence, such as a numerical or alphabetical order. Ordered lists are typically displayed with sequential numbers (or letters) to the left of each item. You create an ordered list using the <ol> element in HTML, and each item within the list is defined using the <li> (list item) element.


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

In this Syntax, there are three list items (Item 1, Item 2, and Item 3) within an ordered list. When rendered in a web browser, this would appear as follows:

  1. Item 1
  2. Item 2
  3. Item 3

The <ol> element defines the start of the ordered list, and each <li> element represents a list item. Ordered lists are commonly used when you want to present a list of items in a specific, meaningful sequence, such as steps in a process, rankings, or any other ordered set of items. Similar to unordered lists, you can also use CSS to style the ordered list and customize the appearance of the numbers or letters.


HTML
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>Ordered List</h1>
    <h2>Students Names: </h2>
    <ol>
        <li>Priya</li>
        <li>Rahul</li>
        <li>Sachin</li>
    </ol>
</body>
</html>