I have a list with an item which, when hovered over, should highlight. I've got this working fine as below:
li.test:hover
{
text-decoration: underline
}
However, this list item contains another list, and using the above CSS rule all list items in the child list become underlined as well. I'd like only the first li
(the one which is actually hovered over) to underline. I did try to use child selectors but I didn't find anything that worked (though it's probably really obvious).
How can I apply a style only to the current element and not its children?
Jsfiddle: http://jsfiddle.net/Mansfield/2CtFW/