HTML <dd> Element

Publish in HTML Tutorial el 23/05/2025 20:14

The <dd> element stands for "Description Details" and is used to provide the description, definition, or value in a description list (<dl>). It typically follows a <dt> (Description Term) element and is part of the trio <dl>, <dt>, and <dd> that creates description lists in HTML.


Key characteristics of <dd>:

  • Must be contained within a <dl> element
  • Usually follows a <dt> element
  • Can contain paragraphs, line breaks, images, links, and other HTML
  • By default, browsers indent <dd> elements
  • Multiple <dd> elements can follow a single <dt>


Basic Syntax

Here's how the <dd> element is structured in HTML:


Examples of <dd> Usage

Example 1: Basic Description List

A simple glossary example using <dd>:

Play Code


Example 2: Multiple Descriptions for One Term

Showing that a single term can have multiple descriptions:

Play Code


Example 3: With Nested HTML Elements

Demonstrating that <dd> can contain other HTML elements:

Play Code


Example 4: Dynamic Content with JavaScript

Using JavaScript to add descriptions dynamically:

Play Code


Example 5: Interactive Description List

Making the description list interactive with JavaScript:

Play Code


Tips and Tricks

  • Styling: Use CSS to customize the indentation of <dd> elements with margin-left or padding-left.
  • Accessibility: Screen readers properly interpret description lists, making them a good semantic choice for glossaries.
  • Flexibility: You can use <div> elements inside <dd> for more complex layouts.
  • Grouping: For long descriptions, consider using <p> tags within the <dd> for better text structure.
  • Responsive Design: Adjust the layout of description lists on mobile by changing the <dd> indentation.


Browser Support

The <dd> element is supported in all modern browsers and has excellent backward compatibility, working even in very old browsers.

También te puede interesar

HTML <style> Element
HTML <style> Element

The <style> HTML element contains style information for a document, or part of a document. ...

HTML <strong> Element
HTML <strong> Element

The <strong> element is used to indicate that its content has strong importance, seriousnes...

HTML <span> Element
HTML <span> Element

The <span> element is an inline container used to mark up a part of a text or document. Unl...

HTML <source> Element
HTML <source> Element

The <source> element is used to specify multiple media resources for media elements like &l...

HTML <small> Element
HTML <small> Element

The <small> element is used to represent side-comments and small print, typically for discl...

HTML <section> Element
HTML <section> Element

HTML <section> Element: The Complete Guide The <section> element is a semantic HTML ...