Saturday, 15 May 2010

Selecting parent list with child in CSS -



Selecting parent list with child in CSS -

i want maintain hover color on parent list, when kid list hovered.

here's illustration sec menu has submenus , when hover on submenus, color of main menu gone.

http://jsfiddle.net/ya8ga/

thanks

html

<div id="menu2"> <ul> <li class="l1"><a href="#">home</a></li> <li class="l2 dropdown"><a href="#">hotel</a> <ul class="sub1"> <li class="l1"><a href="#">hotel sub 1</a></li> <li class="l2"><a href="#">hotel sub 2</a> </li> </ul>

change this:

#menu2 li a:hover{background:#89e00c; color:#2d1c13;}

to this:

#menu2 li:hover{background:#89e00c; color:#2d1c13;}

css

No comments:

Post a Comment