views:

104

answers:

5

Hi,

Does anyone use the DL, DT and DD tags? I have a list with each item having a title and description and was wondering if this would be the best thing to use for it or would the simple ul and li tags be better?

Thanks

A: 

Well, if you have a series of items with descriptions, I'd say that fits into the area of a definition list.

I don't use them personally, purely out of habit to be honest, I probably should though when they're the right thing to use.

Go on, live on the edge, go for it ;)

thebluefox
A: 

Personally i always use UL and LI and never new DL, DT and DD tags existed until a while back when i was experimenting with HTML5. But when working with descriptions maybe DL, DT and DD is better.

Rob
A: 

Yes, a definition list (<dd>) is specifically for lists where each item has a title and description. You can then style them the 'definition term' (AKA title <dt>) and description (<dd>) separately. Your markup will also makes more sense semantically, and be more easily machine-readable. Definition lists have been part of HTML for as long as I can recall. Here's a plain example, and a fancier one, both using <dl> (use Firefox to view the latter, it's still under development).

Dave Everitt
A: 

From a structuration point of view, DL, DT, DD tags are more appropriate for your need. Moreover you can style your specific lists independently from other UL, OL, LI lists without bothering with classes.

mouviciel
+1  A: 

I have used them on occasion. The scenario you describe, items with an title and a description, seems like an excellent candidate for the DL element. It's what the element is made for.

The HTML spec says:

Definition lists, created using the DL element, generally consist of a series of term/definition pairs (although definition lists may have other applications).

Additionally, you can use CSS to customize the appearance of your text.

Daan