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:
- First item
- Second item
- 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
EasyCreate 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>This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
2Text and Formatting
HeadingsParagraphsLine BreaksBold and Italic TextBold and Italic AgainRecap - Formatting8Forms and Inputs Part 1
Form BasicsText InputsInput AttributesPassword FieldLabels for InputsRecap - Basic Form11Event Registration Page
Project OverviewHeader Section9Forms and Inputs Part 2
Radio ButtonsCheckboxesDropdownsButtonsButtons in FormsRecap - Forms #1Recap - Forms #2