HTML ordered lists are used to display a list of items where the order is important.
Ordered lists are commonly used for step-by-step instructions, rankings, procedures, and tutorials.
The <ol> and <li> Tags
An ordered list is created using the <ol> tag.
Each item inside the list is defined using the <li> tag.
In this example:
- <ol> defines the ordered list
- <li> defines each list item
- The browser displays items with numbers by default
Changing the Starting Number
The start attribute is used to change the starting number of an ordered list.
Nested Ordered Lists
Ordered lists can also be nested inside other list items. This is useful for detailed instructions and multi-level steps.
Best Practices for Ordered Lists
- Use ordered lists only when order matters
- Keep steps clear and concise
- Avoid mixing ordered and unordered lists unnecessarily
- Use proper nesting for clarity
Why Ordered Lists Matter for Jobs
Tutorials, documentation, and user guides often rely on ordered lists.
Employers expect developers to present processes and instructions clearly and logically.
Practice Task
Create an ordered list showing steps to create a simple HTML file. Try changing the starting number and nesting a list.
What You Will Learn Next
In the next lesson, you will learn about HTML description lists and how they are used for definitions and structured content.