3

I'm trying to make a menu work so that the menu remains in hover state when it's submenu/child menu is selected:

see example here: http://cssdesk.com/5vJP6

If anyone could explain what needs to be added to the CSS to make this work that would be great. I don't want to use any external javascript to make this happen!

I've had a look at a couple of similar questions here, but none of their answers worked for me

thanks

falter
  • 13,584
  • 5
  • 22
  • 23

3 Answers3

3

I added this:

#menuh ul li:hover a  {color: black !important; border-bottom: 1px dashed #C1D9F0 !important;   }
#menuh ul li:hover li a {color: #505050 !important;}
#menuh ul li:hover li a:hover   {color:  #297BB6 !important;  } 

Which resolved my problem :-)

falter
  • 13,584
  • 5
  • 22
  • 23
2

Define the :hover on the li element instead of the link, for example:

#menuh li:hover A
{
}

(Dito for all a:hovers)

However this won't work in IE6. You'll need to have to JavaScript solution there.

RoToRa
  • 37,635
  • 12
  • 69
  • 105
  • Thanks this has helped - however it seems to have taken over the hover styles of each of the list items (they used to have blue backgrounds before adding rows 113-120) - how would I go about making them different again? – falter Sep 01 '11 at 15:12
1

This was super helpful! Here's what I ended up using to make sure the background and font color of my main nav didn't override the sub nav

#nav ul li:hover a  {background-color: #353535; color: #A98C0C;}
#nav ul li:hover li a {background:none; color: #aaa; }
#nav ul li:hover li a:hover   {background:none; color: #fff;   } 
jod.z
  • 71
  • 1