Which advantages have definition list (<dd><dt>
etc..) and when we should use it?
(Example: use in Zend_Form, but i dont understand why)
Does exist other better options?
(I beginner, but its look to me that is xml use inside html. If I right XML not wide used recently because yaml, file.ini, json each of them in their field more efficient in parsing then xml format.)
Thanks
All HTML tags look like XML. That's because both XML and HTML are closely related to SGML. XML is just a more generalized and "extensible" markup language than HTML.
And I would hardly say that XML is "not widely used", considering that XHTML, RSS, ATOM, RDF, EPUB, XMPP, Microformats, ODF, SOAP, etc. are all XML-based. It's far more popular in general use than YAML, JSON, or ini files—none of which are document markup languages in any case.
So the fact that HTML tags resemble XML is a really silly reason to avoid using a particular tag or set of tags. Markup should be chosen based on the semantic structure of your content, not the popularity of XML in the completely unrelated application of data serialization.
You use DL
when you need to represent a definition list. That is, whenever you have something of the semantic structure:
term: definition
term: definition
term: definition
...
Strictly speaking, definition lists ought to be used only to define terms as in a glossary. But in practice, it's used for a lot more than that. Because HTML doesn't provide tags for specifying other types of pair relationships, DL
is used as a catch-all in this area.
Aside from defining terms, DL
is also used for dialog: the DT
element holds the speaker's name, and DD
holds the line spoken.
A form can also be represented as a definition list, but using the LABEL
tag is more semantically correct IMO.
I usually use DL
when I have to list a set of attributes and their values, e.g.:
File Name: Chloroform Girl.avi
File Size: 320 MiB
File Type: Video