Description and nested lists
Some information is better represented as terms paired with descriptions, or as a hierarchy of related items.
✓ What you will learn in this topic
- Explain the purpose of Description and nested 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
A description list uses dl as its container, dt for a term or name, and dd for its description. It is not limited to dictionary definitions; metadata pairs can also fit. Nested ul or ol structures should remain inside the relevant li so the parent-child relationship stays clear. If a pair is not truly a term and description, a regular list or table may be more accurate.
Syntax
Use dl with dt and dd for term-description groups; place a nested list within its parent li.
Example 1: a small page
The term Habitat is directly associated with its explanation.
<dl>
<dt>Habitat</dt>
<dd>The natural home of a plant or animal.</dd>
</dl>Expected result: The browser shows a term and its description as a related pair.
Example 2: a practical page
The nested items belong to Field kit because the inner list is inside that list item.
<ul>
<li>Field kit
<ul><li>Notebook</li><li>Magnifier</li></ul>
</li>
<li>Water bottle</li>
</ul>Expected result: A main list shows Field kit and Water bottle; the field-kit supplies are indented beneath their parent.
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 dl for term-description relationships and nest lists where the content hierarchy calls for them.
- Choose list type by meaning: sequence, unordered collection, or term-and-description relationship.
Knowledge check
Which elements pair a term with its description?
Show the explanation
A description list uses dl as the container, dt for the term, and dd for its description.
Practical example
html<dl>
<dt>Habitat</dt>
<dd>The natural home of a plant or animal.</dd>
</dl>
Expected result:
The browser shows a term and its description as a related pair.
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