Forum Moderators: open

Message Too Old, No Replies

definition list <dl> semantics

         

Tonearm

4:33 pm on Apr 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is it semantically OK (especially considering search engines) to use a definition list for a category/sub-category listing because of it's nice formatting? I'm trying not to use CSS for this design. Partly because I don't know it.

- Grant

asquithea

5:12 pm on Apr 11, 2004 (gmt 0)

10+ Year Member



Short answer: Maybe

It really depends upon the content of the list. For example, I have a site that enumerates comic strips. The strips are divided by Story, Chapter and Date.

A typical tree might look like this:


All: Clan of the Cats
11: Melpomene
11:2: The Faith
2000-04-16
Strip #294
2000-04-17
Strip #295

Each indent represents another level of <dl> list, but I'm happy with that because the markup is semantically sound. The comic "Clan of the Cats" contains one or more stories, each of which contains one or more chapters, each of which has one or more dates, which has one or more strips.

On the other hand, using <dl> purely for the artistic effect is pointless; there's no guarantee that the list will be indented at all in a particular browser. Indeed, on my site I specifically outline the indentation to be used (using CSS) because the most common browsers have a radically different interpretation of list indentation.

So in summary, it's OK if your list has some kind of meaningful hierachical structure, but don't think that gives you any guarantee about how it's going to look.

aeve

5:33 pm on Apr 11, 2004 (gmt 0)

10+ Year Member



The w3c seems to indicate that there's some semantic freedom for definition lists:
Another application of DL, for example, is for marking up dialogues, with each DT naming a speaker, and each DD containing his or her words.

from: [w3.org...]

search engines won't care but won't give it the extra weight that h* tags would have.

Adam

tedster

6:22 pm on Apr 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



because of it's nice formatting

It's been a while since I tested this, but I remember that there's a lot of variance cross-browser for how definition lists are displayed. That situation was generated by an absence of particulars in the W3C rendering recommendations for user agents.

I assume you are refering to IE's nice default formatting. As you know, that handles a large percentage of your visitors. If you do go down this road, know that there may well be some cross-browser and cross-OS surprises.

Tonearm

8:15 pm on Apr 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



aeve -

You don't think a search engine would appreciate the semantic correctness of a defined list as opposed to the use of a table for display? You would use H tags in a tabled list?

Tonearm

8:18 pm on Apr 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



tedster -

It looked nice in Konqueror and IE6 so I thought it was probably standard. This makes me want to put the list in a table instead. It would be nice to be able to fine-tune the list's spacing with a table.

asquithea

9:13 pm on Apr 11, 2004 (gmt 0)

10+ Year Member



A search engine will prefer a list over a table. Lists of all types tend to look fairly similar between browsers, even though the underlying rendering can be radically different. You can generally expect that dd elements will be indented from dt elements.

Bear in mind that without CSS you have next to no control over rendering, and even with CSS rendering is somewhat implementation. Rather than conducting an exercise in head-burying, might I suggest that learning CSS would improve your options in future?

Tonearm

10:25 pm on Apr 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



asquithea -

I plan to basically build one site and then use that as a template for many. It seems like a good idea to build your site so that even without CSS it looks good. Then if a user's browser doesn't support CSS or has spotty support it will degrade to the plain HTML in varying degrees. That's how I'm hoping it works. Will it happen that way?

pageoneresults

10:31 pm on Apr 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



This makes me want to put the list in a table instead.

Don't do that! ;)

This is all you'll need...

dd{margin:0 0 0 35px;}
dl, dt{margin:15px 0 0 15px;}

Just tweak to your liking.

Tonearm

1:23 am on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks pageoneresults. I think I'll stick with the list and use some CSS on it.

D_Blackwell

4:30 am on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Lists are to CSS what tables were to HTML. A dazzling array of options. Try this on for size. You'll be busy with the good old dl for awhile. [maxdesign.com.au...]

Tonearm

4:41 am on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



D_Blackwell -

That article mentions that heading-based tagging is better than the definition list for search engines. How is heading-based tagging done in a situation like this with a navigation list of all categories and sub-categories?

D_Blackwell

11:36 pm on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tonearm -
You're right to mention that, but I think it depends on how much you want to wring out of every possible SE advantage. I'm generally pretty pleased with the SERPs. Sites are almost always content heavy, which is key for anything I do. Content comes first. The SEs suck it up, and spit out great SERPs.
I like the dl as a design tool, and offer the link primarily as a resource that others might be interested in for that reason. It could be a little off topic for what you're after.

Tonearm

6:09 pm on Apr 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



D_Blackwell -

So you don't think heading-based tagging is necessary in my situation? When would it be appropriately used?