O'Reilly logo

HTML & CSS: The Good Parts by Ben Henick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required