Back to course

Lesson 18: Nested Lists and Definition Lists

The HTML Masterclass: From Zero to Web Developer

18. Nested Lists and Definition Lists

18.1 Nested Lists

You can embed one list inside another to create hierarchical structures. The inner list must be placed inside an <li> element of the outer list.

html

  • Fruits
    • Apple
    • Banana
  • Vegetables
    1. Carrots
    2. Broccoli

18.2 Definition Lists (<dl>)

Definition lists are used for presenting glossary-style data where terms are paired with their definitions.

  • <dl>: Definition List (the container)
  • <dt>: Definition Term (the word/phrase being defined)
  • <dd>: Definition Description (the definition itself)

html

HTML
HyperText Markup Language, the structural foundation of web content.
<dt>CSS</dt>
<dd>Cascading Style Sheets, used for styling and presentation.</dd>