CSS Link Problems
I'm having a bit of difficulty adding some CSS to a link. I'm using 开发者_开发技巧a CMS that automatically generates menus in an unordered list. However, where you're on a given page, it applies class="active" the the li and not to the link itself. This works fine for adding a background to the link, but I'm trying to change the link color.
<li class="active">
<a href="#">Link</a>
</li>
I'm having difficulty coming up with the CSS to say "If a link is in an li
with class="active"
then make the link text color x."
How might I accomplish this?
Thanks!
the path is
li.active a { color: .... }
The MDC CSS Reference has good examples for the various types of selectors.
li.active a {color:whatever}
a
{
color: black;
}
a.active
{
color: green;
}
Try this:
.active a {color: red;}
精彩评论