Dropdown Menu Advice

Hey people!

I’ve used an online help site to construct a CSS-Based Dropdown Menu. It works perfectly. I just need a little advice to help me tweak it a bit.

My code is as follows:

<div id="container">
<div id="menu">
<ul id="item1">
<li class="top"><img src="/wp-content/themes/thepink/images/home.png" height="30px" width="80px" /></li>

<ul id="item2">
<li class="top"><img src="/wp-content/themes/thepink/images/community.png" height="30px" width="125px" /></li>
<li class="item"><a href="/forum/">Forums</a></li>
<li class="item"><a href="/chat/">Chat</a></li>
<li class="item"><a href="/aboutcommunity/">About the Community</a></li>
<ul id="item3">
<li class="top"><img src="/wp-content/themes/thepink/images/videos.png" height="30px" width="90px" /></li>
<li class="item"><a href="/browsevideos/">Browse Videos</a></li>
<li class="item"><a href="/aboutparenttv/">About ParentChannel.TV</a></li>

<ul id="item4">
<li class="top"><img src="/wp-content/themes/thepink/images/shop.png" height="30px" width="85px" /></li>
<li class="item"><a href="#">Browse Auctions</a></li>
<li class="item"><a href="#">Browse Classifieds</a></li>
<li class="item"><a href="#">Create an Ad/Listing</a></li>
<li class="item"><a href="#">About The 1-Stop</a></li>

<ul id="item5">
<li class="top"><img src="/wp-content/themes/thepink/images/astrology.png" height="30px" width="125px" /></li>
<li class="item"><a href="#">Daily Horoscopes</a></li>
<li class="item"><a href="#">Romance</a></li>
<li class="item"><a href="#">Personal Reports</a></li>

<ul id="item6">
<li class="top"><img src="/wp-content/themes/thepink/images/charts_tools.png" height="30px" width="150px" /></li>
<li class="item"><a href="#">Baby Name Finder</a></li>
<li class="item"><a href="#">Due Date Calculator</a></li>
<li class="item"><a href="#">Ovulation Predictor</a></li>
<li class="item"><a href="#">Weight Charts</a></li>

<ul id="item7">
<li class="top"><img src="/wp-content/themes/thepink/images/fun_games.png" height="30px" width="150px" /></li>
<li class="item"><a href="#">Pre-School Games</a></li>
<li class="item"><a href="#">Educational Games</a></li>
<li class="item"><a href="#">Other Games</a></li>
body {

#container {

#menu {
#menu ul .item {
#menu ul:hover .item {
	position: relative;
#menu ul:hover .item a {
	text-decoration: none;
#menu ul:hover .item a:hover {
#menu ul {

.clear {

I just have three questions:

  1. Is the menu WC3 compliant? If not, how do I change it to make it so.

  2. How can I stop the “Top” menu buttons from moving when the menu that pops up underneath is wider than the button itself?

  3. I’ve been told this does not work on an iPhone/iPod - How can I change it so that it’s more universal?

Many thanks in advance for your support.

“Just” lol :slight_smile: Those 3 little questions go to the heart of web development and would take a few good books to answer fully.

  1. Is the menu WC3 compliant? If not, how do I change it to make it so.

If you mean is it valid then run it through the validator and find out :slight_smile:

If you mean is it accessible then the answer is no because there is no keyboard support, no screen reader support and no support for users with motor impaired disabilites (e.g. users who have trouble controlling the mouse).

You should always ensure that the menu can be operated via the keyboard and not just with the mouse.

The menu you are using is an unorthodox and non semantic structure that doesn’t describe the innate hierarchy of a drop down menu very well. Nearly all accessible dropdowns are created with nested lists and not sepearte uls.

You may want to look at some accessible examples to understand more.


Once you have made all the changes to your menu then you need to check it against the accessibility recommendations and satisfy yourself that it meets the multiple criteria specified.

IE6 is not working with your menu because it doesn’t understand hover on any element except anchors and would need javascript support. Javascript support should also be an added enhancement so that there is some delay in the hiding and showing of menus and adding some persistence for motor impaired users.

  1. How can I stop the “Top” menu buttons from moving when the menu that pops up underneath is wider than the button itself?

The sub menus should be removed from the flow and placed absolutely below the trigger item and not in-flow as per your example. The basic suckerfish menu shows the technique required.

  1. I’ve been told this does not work on an iPhone/iPod - How can I change it so that it’s more universal?

The iphone doesn’t support the hover pseudo classes as it is a touch device and therefore isn’t a suitable menu for the iphone. I would recommend you use a normal menu if iphone support is required or enhnace the menu for more capable browsers instead.

See here for the whole mobile approach:


and here:

Sorry, if that sounds a lot of work but your questions were too far reaching for a simple answer :slight_smile: