I have an <li>
that on hover shows a <ul>
beneath it. I finally got the borders aligned but now for some reason the li:hover
color won't change back when I hover off of it. What seems to be happening is that when the <ul>
is active the parent <li>
remains hovered according to CSS.
Here's a jsFiddle showing what's going on:
When the <ul>
is showing and the parent <li>
isn't being hovered over, I'd like the parent <li>
to have the same background color and border color of the <li>
elements within the <ul>
. How can I best fix this while maintaining the border integrity of the entire <div>
?
If you are not opposed to using some jQuery, you could do this
Example: http://jsfiddle.net/Luryf/1/
You could by changing
to
Also you could then put:
To keep it looking consistent. http://jsfiddle.net/Luryf/4/
update: whoops. Seems also needed to move the
border-*
andborder-radius-*
into its own. (fromparent
toparent a
) http://jsfiddle.net/Luryf/8/from:
to:
How's this: jsfiddle
I made it so the #parent li didn't wrap around the ul, changed some css, most importantly, this one:
update
and added this:
Before