HTML & CSS Course
HTML & CSS
/
Beginner

Lists

Definition

HTML provides three types of lists: Unordered Lists `<ul>` (bullet points), Ordered Lists `<ol>` (numbered), and Description Lists `<dl>`.

Explain Like I'm New

If you need to list items, use a list tag! You wrap the entire list in a `<ul>` or `<ol>` container, and then wrap every single item inside it with an `<li>` (List Item) tag.

Real World Example

Navigation menus are almost always built using an Unordered List `<ul>` where the bullets are hidden using CSS. Recipe steps are built using an Ordered List `<ol>`.

Common Use Cases

  • •Bullet points
  • •Numbered instructions
  • •Navigation bars

Interactive Example

Interview Questions

basic

  • What is the difference between `<ul>` and `<ol>`?

intermediate

  • Can you put a list inside of another list?

Flash Cards

Question

ul vs ol?

Click to reveal answer
Answer

`<ul>` (Unordered) uses bullet points. `<ol>` (Ordered) uses sequential numbers (1, 2, 3).

Question

List inside a list?

Click to reveal answer
Answer

Yes! This is called a nested list. You place a new `<ul>` or `<ol>` directly inside an existing `<li>` tag.