The <dd> tag is used in HTML to specify the definition of a term in a definition list, generally within a <dl> (definition list) tag.
Structure and syntax of the <dd> tag
Basic structure and syntax
Here is the basic syntax of a <dd> tag:
<dl>
<dt>Terms</dt>
<dd>Definition of the term</dd>
</dl>The <dd> tag must always be used within the <dl> tag to provide a definition for the term specified in the <dt> tag.
Usage example
Here is an example of using the <dd> tag:
<dl>
<dt>HTML</dt>
<dd>Hypertext Markup Language, the markup language for structuring web pages.</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets, used for styling HTML documents.</dd>
</dl>In this example, the <dd> tag is used to provide the definition for the terms HTML and CSS within a definition list.
Attributes
The <dd> tag does not accept specific attributes other than the generic ones like class, id, or style.
Difference with other similar tags
<dl>: The<dl>tag is used to encapsulate a list of terms with their definitions, and<dd>is used for each individual definition. The<dl>tag itself only contains<dt>and<dd>tags.<dt>: The<dt>tag is used to define the term, while<dd>defines its description or definition within a definition list.
Browser compatibility
The <dd> tag is supported by all modern browsers.
| Browser | Compatibility |
|---|---|
| Chrome | Yes |
| Firefox | Yes |
| Safari | Yes |
| Edge | Yes |
| Internet Explorer | Yes |