parent menu background colour

hi folks i have a drop down menu done in css "i could really learn to hate them" any way this is the url
http://www.nuvaring.aa9/patientsitemap

my problem is when i move my mouse onto one of the sub menu items the main menu background colour reverts back to the on on mouse out action.

the css im using is below

.menu {height:25px;  z-index:100;padding-left:10px; background-color:#ffe383;  }
#nav
{
      font-size:75%;
      height:25px;
      line-height:25px;
      width:730px;
      float:left;
      list-style: none;
}
#nav {
      padding: 0;
      margin: 0;

}
#nav a {
      display: block;
      /*width: 140px;*/
      color:#000;
      text-decoration:none;
      /*width:11em;*/
}
#nav a:hover
{
      color:#FFF;
      background-color:#FBBB37;
}
#nav li {
      float: left;
      width: 9em;
      padding-left:3px;
      width:140px;
}
#nav li a:hover
{
      color:#FFF;
      background-color:#FBBB37;
}
#nav li ul {
      position: absolute;
      width:128px;
      left: -999em;
      background-color:#FBBB37;
}
#nav li ul li {
      padding:6px;
      line-height:15px;
      margin-left:0px;
      width:128px;
      background-color:#FBBB37
}
/*
#nav li ul li a,#nav li ul li a:howver
{
      width:140px;
}
*/
#nav li:hover ul {
      left: auto;

}
#nav li:hover ul, #nav li.sfhover ul {
      left: auto;
}

any help really really aprieciated
LVL 3
andrew67Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zkeownCommented:
Your link isn't working, but what you are experiencing is default behavior. If you want the parent to maintain the "mouseover" aka :hover style while you're browsing the submenu, you'll need some custom javascript to go along with your CSS.
andrew67Author Commented:
your right the link is the wrong one this one works
http://nrd.anytimeafter9.co.uk/patientsitemap

however your answer isnt really what i wanted to hear

zkeownCommented:
*shrug* It's still the right one :) :hover is very basic.  You need more functionality than it provides.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

andrew67Author Commented:
any more clues than that???
zkeownCommented:
Actually...

ul#nav li:hover
{

}

Put your a:hover stuff in that.
andrew67Author Commented:
i have a function to get the drop downs to work in ie6 any idea how i can get the top menu bg to stay coloured in ie6???
andrew67Author Commented:
sorry this is the function
sfHover = function() {
      var sfEls = document.getElementById("nav").getElementsByTagName("LI");
      for (var i=0; i<sfEls.length; i++) {
            sfEls[i].onmouseover=function() {
                  this.className+=" sfhover";
            }
            sfEls[i].onmouseout=function() {
                  this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
            }
      }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

zkeownCommented:
Afraid I can't see a way to do it.  The parent li would need an explicit ID first, otherwise you'd be setting all the parents at the same time.  But I can't think of a way to walk up the tree... maybe I'm just tired.  I hope someone else sees this that can help.
David S.Commented:
Try this:

#nav a,
#nav li:hover li a
 {
	display: block;
	color:#000;
	text-decoration:none;
}
 
#nav a:hover,
#nav li:hover a
{
	color:#FFF;
	background-color:#FBBB37;
}

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
andrew67Author Commented:
hi all sorry for the delay getting back, ive actually found a really good solution here

http://www.cssplay.co.uk/menus/dd_valid.html

just use a different menu simpler and one that works

thanks for all your help
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.