The <dl> HTML/xHTML tag

The <dl> tag is the third most common list type in HTML (after unordered and ordered lists). It’s less flexible than its simpler siblings. What it does is provide a means to list a set of definitions, or name/description pairs.

When to use the <dl> tag (semantic use)

Describe appropriate use, when to use it, when not to use it.

A  may only contain definition terms ( <dt>..</dt>) tags and corresponding definitions (<dd>..</dd>) tags. See examples below.

OK – they can also contain a list header ( <lh>..</lh>) tag, but not many people know or use these.

When the <dl> tag was created as part of the original HTML definition, HTML was focused on marking up academic papers, where definitions of terms are commonplace. Today, HTML is used for loads more stuff, and people have found the <dl> tag useful for more than definitions. A lot of web designers argue that it’s OK to use definition lists for a range of name / value (and even name / value, value or name, name / value combos). A few will stick to the more narrow definition, but this is a bit silly.

It’s valid in all current versions of HTML and xHTML, and it should always have a closing </dl> tag.

Example of <dl> tag use

Usually you’ll have terms & definitions in pairs, as below.

<dl>
<dt>Do</dt>
<dd>A deer, a female deer</dd>
<dt>Re</dt>
<dd>A drop of golden sun</dd>
<dt>Mi</dt>
<dd>A name I call myself</dd>
</dl>

Looks like…

Do
A deer, a female deer
Re
A drop of golden sun
Mi
A name I call myself

The specification seems to allow for more than one definition per term, or more than one term having the same definition, e.g.

<dl>
<dt>Do</dt>
<dd>A deer, a female deer</dd>
<dd>Japanese for “way”</dd>
<dt>Re</dt>
<dd>A drop of golden sun</dd>
<dt>Mi</dt>
<dt>I</dt>
<dd>A name I call myself</dd>
</dl>

Looks like…

Do
A deer, a female deer
Japanese for “way”
Re
A drop of golden sun
Mi
I
A name I call myself

Alternatives to the <dl> tag

You may also consider using:

Unordered lists
Use a <ul> tag where the order of items is not significant.
Ordered lists
Use an <ol> tag where the order of items is significant, e.g. listing events in time order, or race results.

Make Better Web Pages!

How to make your web site sell - use my secrets

Find out How

Do you love our approach to crafting simple & effective web sites that just work for people?

We'd love to hear about your web strategy.

Contact one of our team today!

Leave a comment

Articles + tutorials in Articles

HTML <tfoot> table foot Tag Reference
The tfoot HTML tag means table foot, and defines the foot section of a table.
HTML <thead> table head Tag Reference
The thead HTML tag means table head, and is an optional tag which can enclose the top row of a table to define the cells as column headers.
HTML <applet> Applet Tag Reference
The applet HTML tag means Applet, and it defines an applet embedded in a webpage.
HTML <strike> Strikethrough Tag Reference
The s or strike HTML tags mean Strikeout, and they are used to display text with a solid line through it.
HTML <big> Big Tag Reference
The big HTML tag means Big, and it is used to do display text in a bigger font size than the default.
HTML <a> anchor Tag Reference
The <a> HTML tag creates an anchor in your HTML code, most commonly providing a link to another site, page, or point on a page.
HTML <small> Small Tag Reference
The small HTML tag means Small, and it is used to display text in a smaller font size than the default.
HTML <dir> Directory List Tag Reference
The dir HTML tag means Directory List, and it defines a directory list.
HTML <span> inline span Tag Reference
The span HTML tag means inline span, and is used to apply style to a section of text without breaking the flow of the document.
HTML <tbody> table body Tag Reference
The tbody HTML tag means table body, and contains the rows of data that make up a table.
HTML <kbd> Keyboard Input Tag Reference
The kbd HTML tag means Keyboard Input, and it defines sample code to be input by the user.
HTML <ul> Unordered List Tag Reference
The ul HTML tag creates an unordered list of items.
HTML <blink> Blink Tag Reference
The blink HTML tag means Blink, and it makes text blink on and off repeatedly.
HTML <p> Paragraph Tag Reference
The p HTML tag means paragraph, and it denotes a paragraph of text.
HTML <> Italic Tag Reference
The i HTML tag means Italic, and renders text in italics.
HTML <var> computer code variable Tag Reference
The var HTML tag means variable, and it denotes variable references within computer programs etc.
HTML <dl> Definition List Tag Reference
The dl HTML tag means "definition list" and is used to create a list of name/description pairs.
HTML <menu> Menu List Tag Reference
The menu HTML tag means Menu List, and it defines a list as a menu list.
HTML <basefont> Basefont Tag Reference
The basefont HTML tag means Basefont, and it defines a default font style.
HTML <div> division Tag Reference
The div HTML tag means division, and is basically a general-purpose box that takes up the full width of the space it's in.
HTML <td> table data cell Tag Reference
The td HTML tag means table data cell, and it's the building block of a table.
HTML <samp> Sample Output Tag Reference
The samp HTML tag means Sample Output, and it defines text as sample output from scripts or programs.
HTML <dt> Definition Term Tag Reference
The dt HTML tag stands for "definition term", used as part of HTML definition lists, together with definitions.
HTML <head> Head Tag Reference
The head tag contains the non-visible information about your HTML document.
HTML <tr> table row Tag Reference
The tr HTML tag means table row, and defines a row of data within a table
HTML <u> underline Tag Reference
The underline HTML tag means underline, and it underlines text.
HTML <caption> Table Caption Tag Reference
The caption HTML tag creates a caption for a table, which is like a heading for a table.
HTML <li> List Item Tag Reference
The li HTML tag means "list item". It indicates an elements in a list
HTML <dd> Definition Definition Tag Reference
The dd HTML tag stands for "definition definition"
HTML <col> column Tag Reference
The col HTML tag means column, and it is used to apply certain styles to a whole column in a table.
HTML <ol> Ordered List Tag Reference
The ol HTML tag means "Ordered List"
HTML <th> table header cell Tag Reference
The th HTML tag means table header cell, and defines a column or row header cell.
HTML <br> Line Break Tag Reference
The br HTML tag means line-break, and it inserts a break into a line of text.
HTML <center> Center Tag Reference
The center HTML tag means Center, and it centres its enclosed content.
HTML <table> table Tag Reference
The table HTML tag means table, and it divides content up into rows and columns.
HTML <b> Bold Tag Reference
The b HTML tag means Bold, and renders text as bold.
HTML <font> Font Tag Reference
The font HTML tag means Font, and it specifies the font style of any text it encloses.
HTML <address> Address Tag Reference
The address HTML tag means Address, and is used to define contact details.
HTML <isindex> Is Index Tag Reference
The isindex HTML tag means Is Index, and it displays a single-line textbox, which prompts the user to enter keywords, which are then used to perform a search.
HTML <colgroup> Column group Tag Reference
The colgroup HTML tag represents a column group, and it's used to apply certain styles (usually using CSS classes) to a sequential group of columns in an HTML table.
HTML <marquee> Marquee Tag Reference
The marquee HTML tag means Marquee, and it makes text scroll across the page from right to left.
A-Z List of HTML Tags
Complete HTML/xHTML Tag Reference (39/88 tags documented)
HTML Heading Tag Reference
The h1 - h6 HTML tags mean Heading 1 to Heading 6, and they denote section headings.
Complete HTML/xHTML Tag Reference
© Scratchmedia Limited, 2006-2010
Floor 3, 111 Buckingham Palace Road, London, SW1W 0WQ, UK
+44 (0)207 1600 989