Appropriate use of DL and DD?

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

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

I am not particularly familiar with these tags since I have never used them, but they are not intended for the structure of the document. I'm right? Why should a designer do this?

+3
source share
3 answers

You are right that it cannot be used like that. The only reason I can think that the designer is using them is because the <dd> is indented in most browsers. If they redefine the indentation / margins on them, then your hunch is as good as mine.

+1
source

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

The difference is that in the DL / DD pair, in principle, there is no bullet.

In most cases, it was used for its real use, that is, D efinition L ist, and is used with DT and DD , which are D efinition T erm and D efinition D , which look like this:

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

which by default will depart from the term "bit", and its indentation is still a bit.

+4
source

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

Definition lists differ slightly from other types of lists, in which list items consist of two parts: a term and a description. The term is defined by the DT element and is limited to inline content. Description is given with a DD element that contains block level content.

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

+2
source

All Articles