Should comments be coded as definition lists?
March 3, 2006
I’ve recently re-discovered the definition list tag (thanks to reading Dan Cederholm’s books) and have begun using it for all sorts of situations - such as interviews and now comment lists and I’ve been wondering: should comments be coded by default in blog templates as definition lists?
A definition list seems to better describe the content’s structure than a plain list does.. but it’s not perfect either.
e.g.
<dl>
<dt>Comment author</dt>
<dd>Comment</dd>
</dl>
The W3C says:
Definition lists, created using the DL element, generally consist of a series of term/definition pairs (although definition lists may have other applications).
So… are there any reasons why definition lists aren’t being used by blogging tools?






I tend to like definition lists to mark-up conversations, but Tantek Çelik went postal on them at WE05 in sydney last year. He argued there is no semantic markup to describe a conversation, and using dl is hijacking it’s real semantic meaning. We should be using a microformat instead.
Dunno if I agree, but there are some hard-core standardistas that would look down their nose at you
I guess WordPress’ default of using an OL is meaningful, as the order of the list of comments is important…
— Rowen, March 3, 2006
Thanks Rowen - I’ve been meaning to look at microformatting again.
I’m not set on using dl, I’m just thinking about the best way to code it. OL is ok, but it’s not perfect either.
— Rachel, March 3, 2006
interesting that you posted about this. i just finished reading through andy budd’s css mastery and noticed the very brief paragraph stating that dl’s and dt’s can often be misused.
nonetheless, i’m going to try them out for wordpress comments.
— derek, March 3, 2006
besides, DL’s are so freakin hard to stylize properly, because each definition is formed by two diferent elements with no wrapping parent, which I think is broken. DL’s should be like this for working properly:
Term
definition
Personally I opt for my own personal microformat.
— sosa, March 3, 2006
I’m not quite following this, your example has the
Author
Comment
but there are the other fields in most comment forms like mail and website. Are those terms or definitions? I don’t think either. So, using a definition list excludes important information. You could certainly strip that in the back end, only outputting your list, but why?
You might make some new microformat in XML but I don’t think a dl is the answer here.
— michael, March 3, 2006
I dont think it should for those who want to keep Definition List in there proper use. I think Wired Magazine stretches it’s use on its website to list articles, or at least thats how it was a while ago. Your strick followers of w3c will probably say this is against its proper use, in the same way they would say using a table for non data aesthetic things is wrong.
— John Hamman, March 4, 2006
Nice structure Rachel.
But i have a liitle problem with the header menu.(its hover image)
— Stephan L., March 5, 2006
Thanks Stephan, I’m changing things around quite a bit here…should be working ok now.
— Rachel, March 6, 2006
I think we should look at this using a common sense approach.
Definition Lists (dl) is by it’s name a list of definitions. Within this list of definitions are the terms (dt) and the descriptions (dd) of those terms. Therefore, to show comments using the definition list is semantically inaccurate. It may look pretty when the styles are taken out of the equation, but the purpose of HTML (or XHTML) is to display the data in semantically correct form. Remember, CSS is used to style the data presentation.
So, what are comments? They are conversational pieces of text relating to the subject and relating subjects at the matter. They are displayed in an ORDERLY fashion, as conversations do not exist without some sort of order. Most comments are by default set to OLDEST > LATEST, and therefore should be considered as an ordered list (ol). Remember that comments have authors, which should be cited (cite) properly. This includes blockquotes.
Semantically speaking, you should use the ordered list to represent your comments, however some designs may be too complicated to show this. Therefore we have two options.
Firstly, we can use divisions (div) which is probably the better option if you want to stick to your design. Using divs is a standards compliant method of structuring the data, it may not be entirely semantically accurate, but it is a close method which is employed by thousands of designers/developers.
The other option of course is to redesign, or to develop a design that is simplistic yet creative. I find that the simpler designs with less clutter are much more appealing and potentially prove to be more usable and accessible - not to mention screen reader friendly.
Anyway, interesting debate starter, and very interesting site, well done.
— mik, October 29, 2006