0

I have a navigation with hidden sub menus that display when ever their parent menu link is hovered over. I' a bit stuck on how to actually target the links with the list of the parent navigation item.

Here is my code:

<nav id="nav">
        <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">About</a></li>
        <li>
            <a href="#">Categories</a>
            <ul>
                <li><a href="#">12" Vinyl album</a></li>
                <li><a href="#">12" Vinyl single</a></li>
                <li><a href="#">7" Vinyl album</a></li>
                <li><a href="#">7" Vinyl single</a></li>
                <li><a href="#">CD</a></li>
                <li><a href="#">DVD</a></li>
                <li><a href="#">Book</a></li>
                <li><a href="#">Calendar</a></li>
                <li><a href="#">Other</a></li>
            </ul>
        </li>
        </ul>
</nav>

I have tried the following without any luck:

nav li ul li a:link{
    color:#fba326;
}
4

2 回答 2

1

The only problem I see is that you should use a:hover instead of a:link like so

nav li ul li a:hover{
    color:#fba326;
}
于 2012-06-05T00:18:02.363 回答
0

If you are trying to override the default color of the links. The following CSS would work.

nav li ul li a {
    color: #fba326;
}
于 2012-06-05T00:21:31.097 回答