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

Error using core-scaffold from polymer JS in the latest Polymer Dart release

javascript dart polymer dart-polymer

After hearing that Polymer JS components should work out of the box, which they don't, I went ahead and tried using some Polymer JS elements in my project.

How can I create a ruby script to parse files uploaded by users?

ruby-on-rails parsing ruby-on-rails-3.1

I want users to be able to upload files and then I want to be able to parse them, taking out pieces of information and then declaring them as global variables to be used by other parts of my web