Lists (Ordered & Unordered)

Lists in HTML are used to organize related items in a structured format. They make content easier to read and understand by grouping information clearly.

Ordered List

An ordered list is used when the items need to follow a specific sequence. It displays items in numerical or alphabetical order.

The ordered list is created using the <ol> tag, and each item is written using the <li> tag.

Example of Ordered List

<ol> <li>Step One</li> <li>Step Two</li> <li>Step Three</li> </ol>

Unordered List

An unordered list is used when the order of items does not matter. It displays items with bullet points.

The unordered list is created using the <ul> tag, and each item is written using the <li> tag.

Example of Unordered List

<ul> <li>Milk</li> <li>Bread</li> <li>Eggs</li> </ul>

Difference Between Ordered and Unordered Lists

Ordered lists show items in a sequence using numbers or letters.
Unordered lists show items using bullet points without any specific order.

When to Use Lists

Use ordered lists when showing steps, instructions, or rankings.
Use unordered lists when displaying general items or categories.

Summary

HTML lists help structure content in a clean and readable way. Ordered lists are for sequences, while unordered lists are for simple grouped items.

Home » HTML Fundamentals (Beginner) > Text & Formatting >Lists (Ordered & Unordered)