lucy24 - 8:56 pm on Jul 27, 2013 (gmt 0)
Time for a chorus of
I really hate this damned machine
I wish that they would sell it
It never does quite what I want
But only what I tell it.
The very last thing in the CSS is
If you want to constrain it to a single menu item you'll need to add one more step so the package goes
#top_nav > ul > li > ul > li:hover a
... though at this point frankly I'd think about attaching a class name to the submenus so it can simply say
Obviously not convenient if you've got a dozen submenus and more to come, but if there are only a few, you can do the onetime work and save effort for the browser. (Descendant selectors can make coding much easier, but in exchange the browser has to keep counting on its fingers: a is the child of b which is the child of c which is ... et cetera, instead of homing in on the element itself.)
Edit: Does the "a" need to be there? Can't you hover over a list item? If some items are shorter than others-- as they normally would be-- I think the user might expect the whole block to respond, rather than only the part that contains text.