This is a question, not a quiz. Tell me, can you use definition lists for other things than definitions and descriptions of these definitions?
Some resources that can give you a different point of view:
DL
, DT
, and DD
elements
DL
- definition list [Learning HTML 3.2 by Examples]
My personal opinion is that they can be used for anything that would have such a structure, although the element names say different. If this was not correct, you would probably define those things with a table and that doesn't seem entirely correct too.
I find definition lists very pratical : for lists of definitions of course, for dialogs such as in a theater piece, for bilingual contents, for reciepes, for short notes (title + description)... It is also possible to put in the dd tag : paragraphs, ul- or ol-lists, or... dl lists. See this application : http://perso.wanadoo.fr/pascal.grouselle/essai.htm
For one use, see the Accessibility Statement for my blog. The same definition list (stored internally as a MovableType module and included with an MTInclude
) is used twice on that page; the differing appearance controlled by CSS. Arguably, though, I have not strayed far from the intended purpose. I think Simon Willison's question/response use is OK, but pushing the line. Theater dialog seems to me to have gone too far.
If you're trying to do something really not covered by existing (X)HTML tags, it seems to me to be better to use generic tags and style them using CSS than to use existing tags for a purpose radically different than the one for which they were intended.
Hmmm...
Well, OK. The Spec says that marking up dialogs is an example of an appropriate use of definition lists. In that light, I withdraw my objection to theatrical dialog, and presumably other such things.
I think we're allowed some freedom in our use of definition lists, but we shouldn't stray too far from the original (semantic) meaning.
Using a definition list just because it is rendered in a certain default way in current browser isn't appropriate, IMHO. That would be like using <blockquote>
just to get an indent.
As Jaques Distler, you may be better off using generic elements and styling in many cases.
I, too, wouldn't go too far with definition lists. I remember your idea about marking up your blog as a definition list.
I have seen several blogs since then, doing exactly this. Unfortunately the german Accessibility Blog number one uses this technique. I complained about this, but got no response.
Think about this blog entry. It is a question, and it doesn't provide an answer. So using the dt
, dd
combination feels inappropriate, doesn't it?
<dl> <dt><cite>Anne</cite></dt> <dd><q>There is too little available markup, so is it appropriate to use some already defined elements for multiple purposes?</q></dd> </dl>
Or am I just pushing the line too far here? :-)
Hmm, I've used definition lists for bilevel menus and tabbed interface...
Descriptive lists are handy. I just put together a page for my sister that is a list of products and blurbs about them--not definitions, strictly speaking, but I consider it an appropriate use of the tag.
Using a DL
for alternating Q&A seems a bit odd to me--it gives more weight to the question than the answer, IMO, which probably isn't intended. But I really don't know--I can imagine a case for doing it that way. If you had a browser that, for instance, showed you just the DT
s, and only showed the DD
s when requested, that might be handy with a Q&A list.
I use definition lists when I need to contain name/value pairs. (or name/value+value+value... of course). Were it not for the awkward CSS required, I would markup most forms with definition lists, for example.
So, if I'm understanding this correctly, you may use definition lists for marking up dialogs, but you can also use other elements? Well, now I'm confused. Really nice tab system, liorean.
Martijn,
You are 100% right IMHO. Because markup is all about personal opinions.