Appropriate use of DL and DD?

I had some site templates designed for me recently. I got the final HTML code, which validates, but the structure of the document is laid out using DL-DD pairs:

<dl>
  <dd class="some-class">
    Some text.
  </dd>
</dl>

I'm not especially familiar with those tags as I've never used them much, but they don't seem intended for document structure. Am I right? Why would a designer do this?

Answers


You're right in that it shouldn't be used like that. The only reason I can think of for the designer using them is that the <dd> tag is indented in most browsers. If they're overriding the padding/margins on them, then your guess is as good as mine.


A DL tag is about the same as a UL tag, it starts an unordered list.

The difference being that there basically is no bullet in a DL/DD couple.

Most of the time, though, it's used for it's real use, that is, a Definition List, and is used with DT and DD, which are Definition Term and Definition Description which would look like :

<DL>
  <DT>CSS</DT>
  <DD>Cascading Style Sheet</DD>
</DL>

which will, by default, indent the term a bit, and indent it's definition a bit more.


From WC3: http://www.w3.org/TR/html401/struct/lists.html#h-10.3

Definition lists vary only slightly from other types of lists in that list items consist of two parts: a term and a description. The term is given by the DT element and is restricted to inline content. The description is given with a DD element that contains block-level content.

So given your example, these types of structures should be used for a specific type of content and not structuring of data that does not fit within this context.


Need Your Help

Does XQuery (or XPath) have equivalents to Update, Insert, and Delete as well as Select?

xml xslt xpath xquery

I know how to find what I need from XML using XPath. The syntax takes a little getting used to, but it is quite powerful. I'm interested in learning XQuery also, but the SQL like syntax seems awk...

jpa criteria query duplicate values in fetched list

java list jpa criteriaquery

I'm observing what I think is an unexpected behaviour in JPA 2 when fetching a list attribute with a criteria query.