Definition Lists

June 22nd, 2006

A third kind of list is a definition list, which is (unsurprisingly) a list of terms and their definitions.

Like other lists, a definition list has tags for its beginning and end, but the markup for each list item is different. In the first two list examples, you had two different attributes within each list…the type of list and line items. However, for a definition list you will have three different attributes within the list…the type of list, the term to be defined, and that term’s definition.

The HTML tag for definition lists is <dl>, which stands for definition list. The HTML tag for a term to be defined is <dt>, which stands for definition term. The HTML tag for that term’s definition is <dd>, which stands for definition definition (which is a bit redundant).

As you can see in the example below, the list begins with <dl> and ends with </dl>. Each term goes between <dt> and </dt> tags. Then the defintion for the term goes between <dd> and </dd> tags.


<dl>
  <dt>ordered list</dt>
    <dd>a list where items are numbered</dd>
  <dt>unordered list</dt>
    <dd>a list where the items are bulleted, suggesting that their order is unimportant</dd>
  <dt>definition list</dt>
    <dd>a list of terms and their definitions</dd>
</dl>

The code above would be displayed like this…

ordered list
a list where items are numbered
unordered list
a list where the items are bulleted, suggesting that their order is unimportant
definition list
a list of terms and their definitions