The definition list delivers all that it promises and more. For those who actually need to define some terms, it creates a readable list with staggered margins. And those who want the margins but don't really need a list can easily co-opt the tag for their own purposes.
All definition lists begin with the <dl> tag, and end with </dl>. But unlike their numbered and unnumbered cousins which use the <li> tag to set off list items &$151 the definition list is punctuated with the <dt> and <dd> tags, which differentiate between the terms (<dt>) and their definitions (<dd>).
The HTML for a simple list would go something like this:
And would look like this:
- Larpy
- Of or pertaining to a lack of physical fitness. Larpy people may not be obese, but their muscles have atrophied. A larpy person might sit at a computer 15 hours a day.
- Lascivious
- Characterized by or expressing lust. People seeking lascivious conversation often turn to AOL chat rooms.
So that's why it's called a definition list. But, in truth, the <dl> tag is only rarely used for its intended purpose. More often, you'll spot it indenting text, staggering paragraphs, and generally pushing text around. Take this example:
-
<dl>
<dd>He avoided that side of the street.<br>
<br>
<dl><dl><dl><dd>And who could blame him?<br>
<br>
</dl></dl>
<dd>The birds in the trees were merciless.<br>
<br>
</dl>
<dd>And his long, curly hair was a plum target for pecking.
</dl>
Which displays like this:
- He avoided that side of the street.
- And who could blame him?
- The birds in the trees were merciless.
- And his long, curly hair was a plum target for pecking.
Note that several <dl>s were combined pushing text farther to the right, and pulling it back in. And line breaks indicated by the <br> tag help space out the text. Just remember to finish what you start: Every <dl> must be closed with a corresponding </dl>.