Learning Resources
 

Definition Lists


A definition list is a list of items, with a description of each item.

The

tag defines a definition list.

The
tag is used in conjunction with
(defines the item in the list) and
(describes the item in the list):




  %attrs;                              -- %coreattrs, %i18n, %events --
  >

Start tag: required, End tag: required



  %attrs;                              -- %coreattrs, %i18n, %events --
  >

Start tag: required, End tag: optional

Attributes defined elsewhere

  •     id, class (document-wide identifiers)
  •     lang (language information), dir (text direction)
  •     title (element title)
  •     style (inline style information)
  •     onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup (intrinsic events)


Definition lists vary only slightly from other types of lists in that list items consist of two parts: a term and a description. The term is given by the DT element and is restricted to inline content. The description is given with a DD element that contains block-level content.

Here is an example:

 


 
Dweeb
 
young excitable person who may mature
    into a Nerd or Geek

 
Hacker
 
a clever programmer

 
Nerd
 
technically bright but socially inept person



Here is an example with multiple terms and descriptions:


  
Center
  
Centre
  
A point equidistant from all points
              on the surface of a sphere.
  
In some field sports, the player who
              holds the middle position on the field, court,
              or forward line.


Another application of DL, for example, is for marking up dialogues, with each DT naming a speaker, and each DD containing his or her words.