The Definition List Deserves a Second Look
Writing about HTML elements is a reliable source of small delights, and Ben Myers has taken on one of the more overlooked ones: the <dl> element, which stands for Definition List. In his post, Myers points to common patterns that qualify for this markup — sets of name–value pairs describing lodging amenities, itemized charges on a monthly rent bill, or entries in a glossary of technical terms.
You might have also seen lists of name–value pairs to describe lodging amenities, or to list out individual charges in your monthly rent, or in glossaries of technical terms. Each of these is a candidate to be represented with the
<dl>element.
Myers says HTML semantics satisfy him even when their payoff is only theoretical, and for <dl> at least some of the payoff is concrete: screen readers announce how many items the list contains, as they do for ordered and unordered lists — mostly. That raises an interesting question: which number gets announced? All children regardless of type, or only the <dt> elements?
- Element
- Definition List
- Coolness factor
- 10/10
- Versatility
- 7/10
Grouping children with intermediate <div>s may look odd at first, but those wrappers are acceptable now, and they are useful for styling each group as a row or for drawing a border beneath it. Such <div>s are permitted in definition lists but not in ordered or unordered lists. The post closes on a forward-looking note, wondering whether <hgroup> will return to favor, and credits Jen Kramer's recent "30 days of HTML" series as a fun read.



