CSS menu rollover help

Associate
Joined
1 Oct 2004
Posts
793
Location
Windsor
Just a quick one, struggling with a CSS menu I'm working with. Probably something simple but can't spot it after staring at it all day :o

I have a simple menu. 4 top level choices which have a CSS sprite roll over image. I want one of them to have a drop list. I can get the list to disappear (#services ul {position:relative; list-style: none; display:none;}), but I can't get the list to show when the user hovers.

Please help!

My menu code.

PHP:
<ul id="menu">
      <li id="home"><a href="index.php"><span>Home</span></a></li>
                                
      <li id="about"><a href="about_us.php"><span>About Us</span></a></li>
                     
      <li id="services"><a href="#"><span>Our Services</span></a>
        <ul>
             <li><a href="office_moves.php">Office Moves</a></li>
             <li><a href="it_solutions.php">IT Solutions</a></li>                    
             <li><a href="storage.php">Storage Services</a></li>
             <li><a href="machine_moves.php">Machine Moves</a></li>
             <li><a href="space_planning.php">Space Planning</a></li>
             <li><a href="kingsbury_green.php">Kingsbury Green</a></li>
       </ul>
     </li>

    <li id="contact"><a href="contact.php"></a><span>Contact Us</span></li>
</ul>

My CSS

PHP:
#menu {float:left; width: 502px; height: 29px; margin-top:68px; background:url() no-repeat;}

#menu span {display:none;}

#menu li, #menu a {height:29px; display:block;}
#menu li {float:left; list-style:none; display:inline;}
	
#home {width: 105px;}
#about {width: 110px;}
#services {width: 125px;}
#contact {width: 162px;}

#home a:hover {background:url() -0px -29px no-repeat; }
#about a:hover {background:url() -105px -29px no-repeat; }
#services a:hover {background:url() -215px -29px no-repeat; }
#contact a:hover {background:url() -340px -29px no-repeat; }

#services ul {position:relative; list-style: none; display:none;}

#services ul li{float:left; width:125px;}
#services ul li:hover a {background:url();}
 
Something like:

PHP:
#services:hover ul {display:block;}

should do the trick I think, although it won't work in IE6.. :rolleyes:
 
Back
Top Bottom