W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > July to September 2002

RE: creating a menu

From: Tom James <tom.james@digitext.com>
Date: Tue, 16 Jul 2002 16:39:28 +0100
Message-ID: <BB503C6DCB3BD411A94C00E07D81D64B324BAC@NTSERVER2>
To: "'w3c-wai-ig@w3.org'" <w3c-wai-ig@w3.org>

Randal Rust wrote ...

> I am currently using UL and LI to create menus.
> 
> <ul>
> 	<li class="navHeader">Cheeses</li>
> 	<li>Limburger</li>
> 	<li>Swiss</li>
> </ul>

To me this looks like a list with two levels: the "types of food" (in this
case "Cheeses") and the sub-types (e.g. Limburger etc.) This should be clear
from the mark-up, without any additional hints provided by class attributes.
This attribute is useful for a human reader, but doesn't convey any specific
semantics for a machine, whereas a two level list has such semantic
information built in. (This is the same argument as using <th> for a table
heading, rather than <td class="tableheading">).

So it could be coded:

<ul>
 <li>Cheeses
  <ul>
   <li>Limburger</li>
   <li>Swiss</li>
  </ul>
 </li>
</ul>

and extending to other food types:

<ul>
 <li>Cheeses
  <ul>
   <li>Limburger</li>
   <li>Swiss</li>
  </ul>
 </li>
 <li>Breads
   <ul>
   <li>Bloomer</li>
   <li>Cob</li>
  </ul>
 </li>
 <li>Spreads
   <ul>
   <li>Pickle</li>
   <li>Marmite</li>
  </ul>
 </li>
</ul>

etc - i.e. "Cheeses", "Breads", "Spreads" are in one list, and the specific
items are in sub-lists asscoiated with their particular heading.

	Tom

Dr Tom James
Senior Consultant

===============================================================
Digitext - Online Information at Work

Telephone: +44 (0)1844 214690
Fax: +44 (0)1844 213434
Email: tom.james@digitext.com
Web: http://www.digitext.com/
Received on Tuesday, 16 July 2002 11:37:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 19 July 2011 18:14:05 GMT