HTML Element: dl
Read Time:
1 min
The HTML <dl>
element represents a “description list”. It’s used to present a list of terms and their corresponding descriptions or definitions. You’ll see the <dl>
element used for glossaries, metadata, or any situation requiring a list of terms and their explanations.
Syntax
The <dl>
element wraps one or more <dt>
(term) elements followed by their corresponding <dd>
(description) elements:
1 |
<dl>
|
2 |
<dt>Term 1</dt> |
3 |
<dd>Description 1</dd> |
4 |
<dt>Term 2</dt> |
5 |
<dd>Description 2</dd> |
6 |
<!-- More terms and descriptions -->
|
7 |
</dl>
|
Example
Here’s an example of a simple glossary created using the <dl>
element:
Attributes
The <dl>
element does not have any specific attributes, however, it does inherit from global attributes defined in HTML.
Content
The <dl>
element accepts the following content:
-
<dt>
(term): Represents the term or label. -
<dd>
(description): Represents the corresponding description or definition for the term.
Did You Know?
- The order of
<dt>
and<dd>
elements within a<dl>
does not matter. Browsers usually render them in the order they appear in the HTML, but their visual styling can be modified using CSS.
Learn More
- To learn more about the
<dl>
element, you can check out the official HTML specification.
HTML Elements
Want a weekly email summary?
Subscribe below and we’ll send you a weekly email summary of all new Web Design tutorials. Never miss out on learning about the next big thing.
Sign upI write, teach, and love learning all things web. While I specialize in product design I’m a man of many hats who has worked with mom and pop shops to fortune 500 corporations.
Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.