HTML <dl> tag

The <dl> tag is used to create a definition list. A definition list is a list of words together with their definitions organized in a certain manner.

A definition list is not like other lists in HTML (ordered lists and unordered lists). With a definition list you have two entries for each item in the list - a term and it's definition, while with ordered and unordered lists you just have a list with a bunch of items.

NOTE: The <dl> tag is used together with the <dt> tag (used to specify the definition term) and the <dd> tag (used to specify a definition for the term).

Standard attributes

class, dir, id, lang, style, title, xml:lang

For more information on standard attributes, check out our HTML standard attributes reference page.

Event attributes

onclick, ondblclick, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onkeydown, onkeypress, onkeyup

For more information on event attributes, check out our HTML event attributes reference page.

Example

<dl> <dt><b>HTML</b></dt> <dd>The core language of the world wide web used to create webpages</dd> <dt><b>Javascript</b></dt> <dd>A dynamic client-side scripting language used for webpages</dd> <dt><b>Magazine</b></dt> <dd>A collection of articles and advertisements published periodically</dd> </dl>
Output:
HTML
The core language of the world wide web used to create webpages
Javascript
A dynamic client-side scripting language used for webpages
Magazine
A collection of articles and advertisements published periodically

Tips & notes

Terms in a definition list should be emphasized in some way(like in the above example) to set them apart from the definitions.

Web Reference
  1. CSS reference
  2. RSS reference
  3. HTML reference


© Copyright 2011-2012 Landofcode.com
Terms of use | Privacy policy | Copyright information | Make a donation