Menu
Coddy logo textTech

Ordered List

Part of the Fundamentals section of Coddy's HTML journey — lesson 13 of 60.

In HTML, an ordered list is a list of items that are ordered by numbers or letters. To create an ordered list, you use the <ol> tag. Each item in the list is defined using the <li> tag.

Here's how you can create an ordered list in HTML:

<ol>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
</ol>

In this example, the <ol> tag defines the ordered list, and each <li> tag represents a list item. When displayed in a browser, this code will create a numbered list:

  1. First item
  2. Second item
  3. Third item

Ordered lists are useful for presenting items where the order matters, such as steps in a procedure or a list of ranked items.

challenge icon

Challenge

Easy

Create an HTML document with an ordered list that contains three items: "First", "Second", and "Third". (In that order)

Cheat sheet

An ordered list displays items with numbers or letters. Use the <ol> tag to create the list and <li> tags for each item:

<ol>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
</ol>

Ordered lists are useful when the sequence of items matters, such as steps in a procedure.

Try it yourself

<!DOCTYPE html>
<html>
    <body>
        <!-- Write code here -->
    </body>
</html>
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals