Electric Type

Multimedia

About Us

News

Help

Authoring   HTML Basics
Definition Lists

<dl>  opens a definition list
<dt>  precedes each defined term
<dd>  precedes each definition
</dl> closes the definition list

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:

<dl>
<dt>Larpy
<dd>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.

<dt>Lascivious
<dd>Characterized by or expressing lust. People seeking lascivious conversation often turn to AOL chat rooms.
</dl>

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>.


Got a handle on it? Now try it yourself.



Learn More
View Source
Paragraphs
Headlines
Links
Mailtos
Comment tags
Bold/Italics
Font color
Font size
Teletype
Blink
Preformatted text
Background image
Background color
Blockquotes
Line breaks
Aligning text
Adding/Aligning Images
Ordered lists
Unordered lists
Definition lists
Image borders
Wrapping text



Tutorials  

Authoring  

Teaching Tools  

Backend  

Multimedia  

Design  

E Business  

User Blogs

Screen Shots

Latest Updates

Contact Us

Valid HTML 4.01!
Valid CSS!

Breadcrumb

© ElectricType
Maintained by My-Hosts.com
Site map | Copyright | Disclaimer
Privacy policy | Acceptable Use Policy
Legal information.