<dl>
dl tag
The <dl> element represents a description list, consisting of <dt> for terms and <dd> for their explanations. It is commonly used for glossaries or structured key-value content.
Syntax
<dl>
<dt>Term</dt>
<dd>Description or definition of the term.</dd>
</dl>
dl Demo
These elements create a description list:
- Coffee
- Black hot drink
- Milk
- White cold drink
<h1>The dl, dd, and dt elements</h1>
<p>These elements create a description list:</p>
<dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl>
Definition and Usage
The <dl> tag is used to create a description list. It works alongside the <dt> tag, which defines terms, and the <dd> tag, which provides explanations for those terms.
Global Attributes
The <dl> tag supports all global attributes in HTML.
Conclusion
The <dl> tag is essential for creating description lists in HTML, where terms and their definitions are paired using the <dt> and <dd> tags. It provides a structured way to organize content such as glossaries, dictionaries, and key-value pairs.
<dir>
The HTML <dir> element, which is now obsolete, was intended for creating a directory list of items with specific styling. CSS is recommended for this purpose now.
<dt>
The HTML <dt> element signifies a term within a description list, usually accompanied by a <dd> element that offers the corresponding definition or explanation.