The <dd> tag in HTML is used to define a description or value in a description list, which is created using the <dl> (description list) tag. Each <dd> element is typically preceded by a <dt> (definition term) element, which specifies the term being described.
- Semantic HTML: The <dd> tag helps create a semantically meaningful structure in HTML documents, making it easier for search engines and assistive technologies to understand the content.
- Styling: By default, browsers typically indent the <dd> elements, making them visually distinct from the terms in <dt>. You can style these elements using CSS for further customization.
<!DOCTYPE html>
<html>
<body>
<dl>
<dt>Geeks Classes</dt>
<dd>It is an extensive classroom programme
for enhancing DS and Algo concepts.</dd>
<br>
<dt>Fork Python</dt>
<dd>It is a course designed for beginners
in python.</dd>
<br>
<dt>Interview Preparation</dt>
<dd>It is a course designed for preparation
of interviews in top product based companies.</dd>
</dl>
</body>
</html>
Common Use Cases:
- Glossaries: Listing terms and their definitions.
- FAQs: Organizing questions and answers.
- Metadata: Describing key-value pairs, like technical specifications.
Default CSS for dd Tag:
The default styling for dd tag
dd{
display: block;
margin-left: 40px;
}<!DOCTYPE html>
<html>
<head>
<style>
dd {
display: block;
margin-left: 40px;
}
</style>
</head>
<body>
<dl>
<dt>Geeks Classes</dt>
<dd>
It is an extensive classroom programme
for enhancing DS and Algo concepts.
</dd>
</dl>
</body>
</html>