Table of Contents
Introduction to HTML Lists
Lists are essential for structuring content on web pages. They help present information clearly, whether you’re outlining steps, showcasing features, or defining terms. HTML supports three types of lists:
- Ordered Lists (numbered items).
- Unordered Lists (bulleted items).
- Description Lists (terms and definitions).
Let’s explore each type with examples!
1. Ordered Lists: <ol>
Ordered lists display items in a numbered sequence. They can be used for step-by-step guides, rankings, or ordered content.
Syntax:
HTML
<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>
Example:
Code:
HTML
<ol>
<li>Preheat oven to 350°F.</li>
<li>Mix flour and eggs.</li>
<li>Bake for 20 minutes.</li>
</ol>