Welcome to WebmasterWorld Guest from 3.80.60.248

Forum Moderators: open

Message Too Old, No Replies

Giving a List a Title

What is the valid method for this?

     
1:43 am on Apr 29, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Aug 12, 2005
posts:411
votes: 0


Hello,

I have a list I would like to give a name. Let's say its a list of Operating systems.

I could go this way:

<p>Operating Systems</p>
<ul>
<li>OS 1</li>
<li>OS 2</li>
<li>OS 3</li>
</ul>

But that doesn't seem very proper.

I've scoured around the w3 website, and found them using dl, dt and dd tags, to get something like:

<dl>
<dt>Operating Systems</dt>
<dd>
<ul>
<li>OS 1</li>
<li>OS 2</li>
<li>OS 3</li>
</ul>
</dd>
</dl>

I'm wondering, is this the proper way of doing this? Is it really definition lists, terms and descriptions? Or am I just misinterpreting their examples.

Here's the w3 link to the page where I got the idea from: [w3.org...]

Thanks for any feedback.

4:22 am on Apr 29, 2006 (gmt 0)

Senior Member from CA 

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

joined:Nov 25, 2003
posts:1206
votes: 339


That's the way I've been doing it and for the same reason - the w3c told me to :-)

Actually it makes sense. We usually think of one description per one term but it is very possible and reasonable to have multiple descriptions per term (i.e. a dictionary word may have one or many descriptions) and (albeit rare in practice) one description for many terms or even many to many (your w3c link does give examples of each).

Also as you note there is no inherent method of labeling/naming unordered/ordered lists themselves. So you add a <span> or enclose the list in a <p> or you enclose it in a <dl>. I like the <dl> for retaining the semantics of a list.

Comimg from the other direction - a 'traditional' <dl> might well be visually helped by the bullets of a <ul> within one <dd> rather than multiple <dd>s. A combination of personal preference and semantic considerations.

It also allows even further definition while retaining semantic value i.e. your OS <li>s could each sprout subsequent lists of versions, etc.

There is a lot of unused power in lists.

3:03 pm on Apr 30, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Oct 23, 2003
posts:165
votes: 0


why not


<hn>Operating Systems</hn>
<ul>
<li>OS 1</li>
<li>OS 2</li>
<li>OS 3</li>
</ul>

replacing the n with a number 1-6.

If it's a heading why not mark it up as such?

7:10 pm on Apr 30, 2006 (gmt 0)

Senior Member from CA 

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

joined:Nov 25, 2003
posts:1206
votes: 339



If it's a heading why not mark it up as such?

There is a difference between a heading and a name/label/title. If the list is an actual section of content by itself or leads the section then using the heading to 'label' the list may well be best practice. There are likely other situations where <hn> list naming would also be appropriate.

7.5.5 Headings: The H1, H2, H3, H4, H5, H6 elements [w3.org]


A heading element briefly describes the topic of the section it introduces.

However, a section may contain one or more lists plus <p>s and <img>s, etc. wherein some other individual list identifying mechanism may be more useful. And as discussed there is an accepted methodology.

9:42 am on May 6, 2006 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 29, 2005
posts:9033
votes: 752


Both seem logical, however I am curious...where's the rule books for list naming? Until there is a SEMANTICS validator (that I trust and agree with) I'll continue to code pages that make sense.

<hn>HEADER THIS SECTION</hn>
<dl>
<dt>A Term</dd>
<dd>A Description</dd>
</dl>

And a LIST

<hn>HEADER THIS SECTION</hn>
<ol>
<li>item1
<li>item2
</ol>

If content is that important it requires a title then insert inside an appropriate TABLE, complete with headers, captions, etc.

I suppose we could reinvent the wheel... but why? :)

We could NAME the sectioned list inside a DIV with a description.

10:50 am on May 7, 2006 (gmt 0)

New User

10+ Year Member

joined:Apr 28, 2006
posts:7
votes: 0


Check out the Web Standards Group. I think wsg.org from memory and you will find a group of extremely pedantic people who will answer your question.

When I say pedantic, I mean in the nicest possible way. They seek to maintain the highest standards of markup.

Kind regards,

Ric

12:29 am on May 8, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 29, 2003
posts:1676
votes: 0



There is a lot of unused power in lists.

Lists are indeed mighty handy. For the question posed, I kind of like <dl> with multiple <dd>.

Definition Lists [maxdesign.com.au]

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members