Cover by Ben Henick

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Definition Lists

Where ordered and unordered lists are simple heaps of data with members that share a vague classification, definition lists imply definite relationships between their terms (indicated by dt elements) and their definitions (indicated by dd elements). Each term is followed by one or more definitions, which are understood to relate strictly to the term.

To be valid, a definition list must contain at least one dt or dd element; to be semantically useful, it must contain at least one of each. dt elements may only contain text and inline elements, while dd elements can contain the same broad range of content as li elements. There is no restriction on the number or arrangement of dd and dt elements within a given definition list; it’s left to content authors to ensure that definition list elements are arranged sensibly.

Styling Definition Lists

The user agent styles applied to definition lists are minimal, and can be described as follows:

  • dt elements are not unlike paragraphs without margins.

  • dd elements are offset with margin-left, but never take a marker.

  • dd elements have the same (lack of) constraints on valid contents as li elements.

  • Definition list text content is set in unstyled type by default.

The most common uses for a definition list are lexica (e.g., glossaries, dictionaries) and transcribed dialogue. The first of these is fairly straightforward, and the user agent styles will usually be adequate to that purpose, with the caveat that a particularly typography-conscious ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required