HTML/Elements/dl

From W3C Wiki
< HTML‎ | Elements
Jump to: navigation, search

<dl>

The <dl> element represents a description list.

Point

  • Each list consists of one or more names (<dt> elements) followed by one or more values (<dd> elements).
  • In some cases (typically a glossary), a <dfn> element may indicate the word being defined. [Example D]

HTML Attributes

See global attributes.

Examples

Example A

[try it]

<dl>
  <dt>term1</dt>
  <dd>definition1</dd>
  <dt>term2</dt>
  <dd>definition2</dd>
</dl>

Dl01.png

Example B

A term can have multiple definitions:

<dl>
  <dt>term</dt>
  <dd>definition1</dd>
  <dd>definition2</dd>
</dl>

Dl02.png

Example C

A definition can have multiple terms:

<dl>
  <dt>term1</dt>
  <dt>term2</dt>
  <dd>definition</dd>
</dl>

Dl03.png

Example D

Here is an example of glossary:

<dl>
  <dt><dfn>Bee</dfn>, n.</dt>
  <dd>A buzzing insect, known for its role in pollination.</dd>
  <dt><dfn>Buzz</dfn>, v.</dt>
  <dd>To make a continuous, humming noise, like that made by bees.</dd>
</dl>

HTML Reference

The HTML5 specification defines the <dl> element in 4.5.8 The dl element.