<dd> Tag in HTML
The <dd> tag is used within a <dl> (description list) to define the description or details of a term specified by the <dt> tag. The <dd> tag provides additional information related to each term in the list.
Key Points on <dd> Tag:
- The <dd> tag is always used inside a <dl> element.
- Each <dt> (definition term) is typically followed by a <dd> (definition description) to give a description or explanation of the term.
- It’s commonly used to create glossary-style lists, FAQs, or any scenario where a term-description structure is needed.
Syntax of <dd> Tag:
Syntax Example
<dl>
<dt>Term</dt>
<dd>Description of the term</dd>
</dl>
Example of <dd> Tag in HTML:
This example demonstrates how to create a description list using <dt> and <dd> tags.
Code Example
<dl>
<dt>HTML</dt>
<dd>A markup language for creating web pages.</dd>
<dt>CSS</dt>
<dd>A style sheet language used to define the look and formatting of a document.</dd>
<dt>JavaScript</dt>
<dd>A programming language commonly used in web development for interactivity.</dd>
</dl>
Output
- HTML
- A markup language for creating web pages.
- CSS
- A style sheet language used to define the look and formatting of a document.
- JavaScript
- A programming language commonly used in web development for interactivity.
The <dd> tag is most effective for creating structured lists where each term needs a definition or detailed explanation, making it an ideal choice for glossaries, dictionaries, and FAQs.