Skip to the workspace
Pebellslearn by building
Lists  ›  Lesson

Description Lists

Definition lists 12 minA description list, dl, pairs terms in dt with their descriptions in dd, suiting glossaries, specifications and question and answer pairs.

html / Description Lists

Explore each scene at your own pace.

01 · The rule

The rule

Description Lists

A description list, dl, pairs terms in dt with their descriptions in dd, suiting glossaries, specifications and question and answer pairs.

Pair terms with their descriptions using the appropriate list structure.

A glossary pairs words with meanings. A product page pairs "Weight" with "1.3 kg". An FAQ pairs questions with answers. All of these are lists of pairs, and HTML has a list built exactly for that shape.

The rule

dl holds pairs: dt names it, dd describes it.

A description list has three elements:

  • <dl> wraps the whole list.
  • <dt> holds a term: the name, label or question.
  • <dd> holds the description: the definition, value or answer. It follows its dt.
<dl>
  <dt>Monsoon</dt>
  <dd>A seasonal wind that brings heavy rain to South Asia from about June to September.</dd>

  <dt>Retreating monsoon</dt>
  <dd>The period when the rain-bearing winds withdraw, usually October and November.</dd>
</dl>

You will often see it called a "definition list", its older name. The modern HTML standard calls it a description list because it is not only for definitions. Anything shaped like name → value fits:

<dl>
  <dt>Processor</dt>   <dd>8-core, 3.2 GHz</dd>
  <dt>Memory</dt>      <dd>16 GB</dd>
  <dt>Weight</dt>      <dd>1.3 kg</dd>
</dl>

Pairs do not have to be one to one. One term can have several descriptions (a word with two meanings), and several terms can share one description (two spellings of the same word). Just keep each group's dt elements first, followed by its dd elements.

Browsers indent dd by default. As always, that is only styling; CSS can show the pairs side by side, in a table-like grid or as cards.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.