An HTML description list is used to display term and definition pairs — similar to a dictionary or glossary. It is the third type of list in HTML alongside unordered and ordered lists.
A description list uses three tags together:
| Tag | Name | Purpose |
|---|---|---|
<dl> | Description List | The container for the whole list |
<dt> | Description Term | The term or name being defined |
<dd> | Description Data | The definition or description of the term |
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language — the standard language for creating web pages.</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets — used to style and layout web pages.</dd>
<dt>JavaScript</dt>
<dd>A programming language that adds interactivity to web pages.</dd>
</dl>
Result:
A single <dt> can have multiple <dd> elements for multiple definitions:
<dl>
<dt>Apple</dt>
<dd>A fruit that grows on trees.</dd>
<dd>A technology company known for iPhones and Macs.</dd>
</dl>
Result:
Multiple <dt> elements can share a single <dd>:
<dl>
<dt>HTML</dt>
<dt>Hypertext Markup Language</dt>
<dd>The standard language for structuring web content.</dd>
</dl>
<dt>, answer as <dd><dl>
<dt>What is HTML?</dt>
<dd>HTML is the standard markup language for creating web pages.</dd>
<dt>Is HTML a programming language?</dt>
<dd>No. HTML is a markup language, not a programming language.</dd>
</dl>
<dd> elements to visually separate them from the <dt>. You can adjust this spacing with CSS margin and padding.