CSS problem with a class
Can you help me to set the text color of the class slide
anchors? Here in http://jsfiddle.net/x7zpd/ is my problem shown.
<div id="menu-demo">
<ul>
<li>
<div class="up">
<a href="#">INICIO</a></div>
<div class="slide">
<a href="#">INICIO</a></div>
</li>
开发者_Python百科#menu-demo li a {
text-decoration:none;
color:#aaa;
font-size:20px;
font-family:Tahoma, Geneva, sans-serif;
}
.up {
margin-top:13px;
margin-bottom:40px;
}
.slide
{
background-color: #ffc; /* delete me */
color: black;
}
Here you go.
#menu-demo li .slide a { background-color: #ffc; /* delete me */ color: black; }
... otherwise the normal a
will have priority, since it's more internal and IDs + hierarchy have priority on classes.
The anchor tag has a color assigned to it as well that overrides the color of the parent container. You also need a .slide A{color:#000;} in there as well.
精彩评论