KodingKaro
HTML · Beginner · Lists

Unordered and ordered lists

Lists help readers scan collections and sequences because each item is announced and grouped as part of one structure.

✓ What you will learn in this topic

  • Explain the purpose of Unordered and ordered lists in a real HTML document.
  • Choose and apply the elements shown in both examples.
  • Recognize the specific mistake described in this lesson.

Concept explanation

Use ul when the order is not meaningful and ol when steps, ranking, or sequence matters. Each direct item belongs in an li. A nested list goes inside the li that owns it. The list marker is visual; changing its appearance with CSS does not change the underlying order or meaning.

Syntax

Choose ul for a collection or ol for a sequence, then place each item in li.

Example 1: a small page

The unordered list groups two grocery items with no required order.

<ul>
  <li>Tea</li>
  <li>Oats</li>
</ul>

Expected result: The browser displays Tea and Oats as two bulleted items.

Example 2: a practical page

The recipe actions form a sequence, so an ordered list reflects their relationship.

<ol>
  <li>Wash the berries.</li>
  <li>Slice the fruit.</li>
  <li>Serve with yogurt.</li>
</ol>

Expected result: Three steps appear as a numbered list in the order they should be completed.

Common mistakes

Put list items inside a list container; do not use repeated br or symbols as a substitute for list structure.

Best practices

Choose list type by meaning: sequence, unordered collection, or term-and-description relationship.

Practice exercise

Create an unordered packing list, a numbered three-step process, and a description list explaining three workshop terms.

Lesson summary

  • Use ul for an unordered group, ol for a sequence, and li for each member.
  • Choose list type by meaning: sequence, unordered collection, or term-and-description relationship.

Knowledge check

Which list element best represents ordered recipe steps?

Show the explanation

Use ol because the steps have a meaningful sequence.

Practical example

html
<ul>
  <li>Tea</li>
  <li>Oats</li>
</ul>

Expected result:

The browser displays Tea and Oats as two bulleted items.

Hands-on practice task

Create an unordered packing list, a numbered three-step process, and a description list explaining three workshop terms.

In this section

Other lessons in Lists

Broaden your knowledge

Related learning topics