YouTip LogoYouTip

Tag Dd

The HTML `
` element represents the description, definition, or value of a preceding term (`
`) within a description list (`
`). While commonly associated with dictionary-style definitions, the `
` tag is a highly versatile semantic element used for any metadata name-value pairs, such as dialogue scripts, product specifications, or key-value glossaries. --- ## 1. Introduction The `
` tag stands for **Description Details** (or Definition Description). It is designed to be used exclusively as a child of a `
` (Description List) element, and it almost always follows a `
` (Description Term) element. ### Why Use `
`? * **Semantic Accuracy**: Using `
` instead of generic `
` or `` tags tells search engines and assistive technologies (like screen readers) that the enclosed text is directly related to the preceding term. * **Accessibility (a11y)**: Screen readers announce description lists differently, allowing visually impaired users to navigate quickly between terms and their corresponding descriptions. * **Styling Flexibility**: By default, browsers apply a left margin (`margin-start`) to `
` elements, but they can be easily styled with CSS to create modern, responsive layouts like two-column metadata grids. --- ## 2. Syntax and Usage The `
` element must be wrapped inside a `
` parent container. It can contain flow content, meaning you can place paragraphs, images, links, lists, or even other block-level elements inside it. ### Basic Structure ```html
Term
Description of the term
``` ### Permitted Relationships * **One-to-One**: One term followed by one description. * **Many-to-One**: Multiple terms share the same description. * **One-to-Many**: One term has multiple descriptions (e.g., a word with multiple definitions). ### Attributes The `
` tag supports all **HTML Global Attributes** (such as `class`, `id`, `style`, `lang`, and `dir`) and **Event Attributes**. It does not have any unique, element-specific attributes. | Attribute | Type | Description | | :--- | :--- | :--- | | `class` | *String* | Assigns CSS classes for styling. | | `id` | *String* | Provides a unique identifier (useful for anchor links). | | `aria-*` | *String* | Accessibility attributes to define ARIA states and properties. | --- ## 3. Code Example Below is a complete, semantic, and styled example demonstrating how to use `
`, `
`, and `
` to build a modern, responsive product specification sheet. ```html HTML dd Tag Example

Device Specifications

Product Name
UltraBook Pro 15
Processor
Octa-core ARM-based Architecture
Memory Options
16 GB Unified RAM
32 GB Unified RAM
Storage
512 GB PCIe NVMe SSD
Operating System
WebOS Desktop Edition
``` --- ## 4. Best Practices and Common Pitfalls ### 1. Always Wrap `
` in a `
` Parent A `
` element is invalid HTML if it is not a direct child of a `
` element (or wrapped inside a `
` that is a direct child of a `
` in modern HTML5). * **Incorrect:** ```html
Term
Description
``` * **Correct:** ```html
Term
Description
``` ### 2. Reset Default Browser Margins By default, user-agent stylesheets apply a `margin-inline-start: 40px` (left margin) to the `
` tag. When building custom layouts (like grids or flexbox), always explicitly reset this margin in your CSS: ```css dd { margin: 0; } ``` ### 3. Do Not Use for Visual Indentation Alone Because browsers indent `
` by default, developers sometimes misuse it to indent regular body text. This breaks semantic structure and confuses screen readers. If you only need visual indentation, use CSS `margin-left` or `padding-left` on a standard `

` or `

` tag instead.
← Tag DelTag Datalist β†’

YouTip © 2024-2026 | Home | Learn Technology, Build Dreams!

All content is for educational and learning purposes only.