HTML: <dl> tag
This HTML tutorial explains how to use the HTML element called the <dl> tag with syntax and examples.
Description
The HTML <dl> tag is used to define a description list in the HTML document. A description list is a list of grouped terms (found within the <dt> tag) and a corresponding description (found within the <dd> tag). This tag is also commonly referred to as the <dl> element.
Syntax
In HTML, the syntax for the <dl> tag is:
<dl>
<dt>Term1</dt>
<dd>Description of Term1<dd>
<dt>Term2</dt>
<dd>Description of Term2<dd>
</dl>
Sample Output
Attributes
Only the Global Attributes apply to the <dl> tag. There are no attributes that are specific to the <dl> tag.
Note
- The <dl> element is found within the <body> tag.
- The <dl> tag is commonly used to display glossaries or definitions of terms.
- The <dl> tag can contain zero or more groups with each group made up of one or more terms (found in <dt> tags) followed by one or more descriptions (found in <dd> tags).
-
For each group, there must be at least one <dt> tag followed by at least one <dd> tag. This means that it is possible to list:
- a single term followed by a single description
- a single term followed by multiple descriptions
- multiple terms followed by a single description
- multiple terms followed by multiple descriptions
Browser Compatibility
The <dl> tag has basic support with the following browsers:
- Chrome
- Android
- Firefox (Gecko)
- Firefox Mobile (Gecko)
- Internet Explorer (IE)
- Edge Mobile
- Opera
- Opera Mobile
- Safari (WebKit)
- Safari Mobile
Example
We will discuss the <dl> tag below, exploring examples of how to use the <dl> tag in HTML5, HTML 4.01 Transitional, XHTML 1.0 Transitional, XHTML 1.0 Strict, and XHTML 1.1.
Advertisements