Hi,
I have got a horizontal drop down menu working as it should but just can’t seem to get the top level links to stay on when the sublinks are hovered over.
The top level links on hover have a white background but this disappears when i hover over the sublinks, except when the top level is ‘active’.
I think i’ve tried every permutation I can think of but without success…if someone can take a quick look over the code maybe something obvious that i’m missing will surface…
HTML:
<div class="menu">
<ul>
<li><a href="#" title="About us"><span>About us</span></a>
<!--[if lte IE 6]>
<a href="#" title="About us">About us<table><tr><td>
<![endif]-->
<ul>
<li><a href="#" title="Quotes" class="Quotes "><span>Quotes</span></a></li>
<li><a href="#" title="History" class="History "><span>History</span></a></li>
<li class="last"><a href="#" title="Press" class="Press "><span>Press</span></a></li>
</ul>
<!--[if lte IE 6]>
</td></tr></table>
</a>
<![endif]-->
</li>
<li><a href="#" title="Booking" class="Booking "><span>Booking</span></a></li>
<li><a href="#" title="Contact" class="Contact "><span>Contact</span></a></li>
</ul>
</div>
CSS:
.menu {
padding:0 0 67px;
width:800px;
position:relative;
z-index:100;
text-transform: uppercase;
font-weight: bold;
height: 23px;
border-top:3px solid #fff;
border-bottom:1px solid #fff;
font: Helvetica, Arial, sans-serif;
font-size: 89%;
}
.menu ul {
padding:0;
margin:0;
list-style-type: none;
}
/* float the list so that the items are in a line and their position relative so that the drop down list will appear in the right place underneath each list item */
.menu ul li {
float:left;
position:relative;
}
/* Set the background color and the font size*/
.menu ul li a, .menu ul li a:visited {
display:block;
text-align:left;
text-decoration:none;
height:23px;
line-height:23px;
padding: 0 13px;
color: #fff;
}
.menu ul li a:hover, .menu ul li.active a, .menu ul li.active a ul li a:hover {color: #000; background: #fff;}
/* make the dropdown ul invisible */
.menu ul li ul {
display: none;
}
/* specific to non IE browsers */
/* set the background and foreground color of the main menu li on hover */
.menu ul li:hover a, .menu ul li.active a{
background-position: 0px 0px;
}
/* make the sub menu ul visible and position it beneath the main menu list item */
.menu ul li:hover ul {
display:block;
position:absolute;
top:23px;
left:0px;
width:120px;
background:#fff;
padding: 0 5px;
}
.menu li li {float:none;}
/* style the background and foreground color of the submenu links */
.menu ul li:hover ul li a {
display:block;
background:#fff;
color:#000;
padding: 4px 8px 0 8px;
line-height: 9px;
margin:0px;
font-size: 90%;
height: 16px;
}
.menu ul li:hover ul li a span {padding-left: 4px;}
.menu ul li:hover ul li a
.menu ul li ul li.last {padding-bottom: 2px;}
/* style the background and foreground colors of the links on hover */
.menu ul li:hover ul li a:hover {
color:#feba12;
}
Thanks for any help
G