<dl> (Definition List)
This element encloses a list of terms and definition pairs. A common use for this element is to implement a glossary.
Standard Syntax
<dl
class="class name(s)"</dl>
compact="compact" (transitional only)
dir="ltr | rtl"
id="unique alphanumeric identifier"
lang="language code"
style="style information"
title="advisory text"
Attributes Defined by Internet Explorer
accesskey="key" (5.5)
contenteditable="false | true | inherit" (5.5)
disabled="false | true" (5.5)
hidefocus="true | false" (5.5)
language="javascript | jscript | vbs | vbscript" (4)
tabindex="number" (5.5)
unselectable="on | off" (5.5)
Standard Events
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
Events Defined by Internet Explorer
onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresizeend, onresizestart, onselectstart, ontimeerror
Element Specific Attributes
- compact
- This attribute reduces the white space between list items.
Example
<dl>
<dt>Cat
<dd>A domestic animal that likes fish
<dt>Skunk
<dd>A wild animal that needs deodorant
</dl>
Compatibility
HTML 2, 3.2, 4, 4.01, XHTML 1.0, 1.1, Basic
Internet Explorer 2, 3, 4, 5, 5.5, 6
Netscape 1, 2, 3, 4- 4.7, 6
Opera 4-7
Notes
The items in the list comprise two parts: the term, indicated by the dt element, and its definition, indicated by the dd element.
Some page designers might use a <dl> tag or <ul> tag to create text indention. Although this is a common practice on the Web, it is not advisable because it confuses the meaning of the element by making it a physical layout device rather than a list.
HTML 2 and 3.2 support only the compact attribute for this element.
For XHTML compatibility, the compact attribute must be expanded: <dl compact="compact"> under the transitional form. It is deprecated under the strict specification.