HTML Description Lists: Terms and Values
Associate names and descriptions
A description list (dl) groups names and corresponding values. Use dt for each name or term and dd for its description or value. It is useful for a glossary, specifications or a set of labeled facts, not just dictionary definitions.
<dl> <dt>Duration</dt> <dd>45 minutes</dd> <dt>Level</dt> <dd>Beginner</dd></dl>Two name-value groups describe the workshop. Browsers often indent descriptions by default.
Use more than one name or value
Each group consists of one or more consecutive dt elements followed by one or more consecutive dd elements. Multiple names can share a description, or a single name can have several values. Start a new group with the next dt.
<dl> <dt>CSS</dt> <dt>Cascading Style Sheets</dt> <dd>A language for describing presentation.</dd> <dt>Contact methods</dt> <dd>Email</dd> <dd>Phone</dd></dl>The first two names share a description; the contact group has two values.
Wrap complete groups when needed
If you need a wrapper for styling or group metadata, place each complete name-value group in a div directly inside the dl. In ordinary content, use either unwrapped dt/dd groups or wrapped groups consistently; do not wrap individual terms and descriptions separately. Do not use dl merely to indent text.
<dl> <div class="fact"> <dt>Language</dt> <dd>English</dd> </div> <div class="fact"> <dt>Format</dt> <dd>Online</dd> </div></dl>Each wrapper contains a complete group. The class can later be used for styling; it does not itself change the appearance.
Practice and next steps
Describe a book using two name-value pairs. Then try grouping a pair that has two values.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
HTML Description Lists: Terms and Values — Knowledge Check
Check the core concepts from this lesson.
Which element contains the value for a name in a description list?
Can two consecutive dt elements share a single dd?
What belongs inside each optional div wrapper in a dl?
Which structure suits a glossary term with two definitions?
Which task is a good use of a description list?