HTML: Definition List: dl dt dd

By Xah Lee. Date: . Last updated: .

What is definition list

Definition list (or description list), is a list where each item has a term, followed by one or more definition or description.

Definition list tags

dl

definition list.

inside it, should be sequence of:

  • dt (for the term. can be more than one.)
  • dd (for the definition. can be more than one.)
<dl>
 <dt>Cat</dt>
 <dd>4 legs.</dd>

 <dt>Octopus</dt>
 <dd>8 Tentacles.</dd>
</dl>
dt

Definition term. For each definition item.

You can have more than one dt before any dd.

Example

cat
dog
mouse
animal
<dl>
 <dt>cat</dt>
 <dt>dog</dt>
 <dt>mouse</dt>
 <dd>animal</dd>
</dl>
dd

Definition description.

You can have more than one dd for each dt.

<dl>
 <dt>Cat</dt>
 <dd>Furry</dd>
 <dd>Lovely</dd>

 <dt>Octopus</dt>
 <dd>Smart</dd>
 <dd>Many legs</dd>
</dl>

Example

Browser shows

Cat
4 Legs. Furry. Cuddly.
Octopus
8 Tentacles. Smart.

Code

<div>
<style>@scope {
 dl {
  all: revert;
  border: solid 1px silver;
  padding: 8px;
 }

 dt {
  all: revert;
  color: red;
 }

 dd {
  all: revert;
  color: green;
 }
}</style>

 <dl>
  <dt>Cat</dt>
  <dd>4 Legs. Furry. Cuddly.</dd>

  <dt>Octopus</dt>
  <dd>8 Tentacles. Smart.</dd>
 </dl>
</div>