I searched on the web and here and didn't find such case. The problem is that I can't change the color of the link. I have the following structure:
我在网上和这里搜索过,但没有找到这种情况。问题是我无法改变链接的颜色。我有以下结构:
<ul id="footer_menu">
<li class="footer_title">Sobre</li>
<li><a href="#">Sobre nós</a></li>
<li><a href="#">Entre em contato</a></li>
<li><a href="#">Contribua</a></li>
</ul>
a {
text-decoration: none;
-webkit-transition: all .2s linear;
-moz-transition: all .2s linear;
-ms-transition: all .2s linear;
-o-transition: all .2s linear;
transition: all .2s linear;
}
ul#footer_menu li a{
color: #848587;
}
ul#footer_menu li a:hover {
color: #FFFFFF;
}
So as you can see, I tried put the most specific path for the links on footer_menu but the color of the links still continue blue and surprising the hover is working correctly.
所以你可以看到,我尝试在footer_menu上为链接添加最具体的路径,但链接的颜色仍然是蓝色,并且令人惊讶的是悬停工作正常。
If anybody could help me. Actually I'm just asking because everything seems be fine. I can't put the color in the first a because no my links will have the same color.
如果有人可以帮助我。其实我只是问,因为一切似乎都很好。我不能把颜色放在第一个a中,因为没有我的链接会有相同的颜色。
Thank you
3 个解决方案
#1
2
Try This
<nav id="myslidemenu">
<ul>
<li><a href="what-we-do.html">What we do</a></li>
<li><a href="our-services.html">Our services</a></li>
<li><a href="who-we-are.html">Who we are</a></li>
<li><a href="case-studies.html">Case studies</a></li>
<li><a href="testimonials.html">Testimonials</a></li>
</ul>
</nav>
CSS
nav ul li a{
color:#000;
border-bottom: 1px solid #FFBE08;
-webkit-transition: border-bottom linear 1s;
-moz-transition: border-bottom linear 1s;
-o-transition: border-bottom linear 1s;
transition: border-bottom linear 1s;
text-decoration:none;
}
nav ul li a:hover{ color:#000; border-bottom:1px solid #000; }
#2
0
Try this:
ul#footer_menu li a{
color: #848587 !important;
}
#3
-1
Take a look at Fiddle it works completely fine
看看Fiddle它完全没问题
ul#footer_menu li a{
color: red;
}
ul#footer_menu li a:hover {
color: #FFFFFF;
}
#1
2
Try This
<nav id="myslidemenu">
<ul>
<li><a href="what-we-do.html">What we do</a></li>
<li><a href="our-services.html">Our services</a></li>
<li><a href="who-we-are.html">Who we are</a></li>
<li><a href="case-studies.html">Case studies</a></li>
<li><a href="testimonials.html">Testimonials</a></li>
</ul>
</nav>
CSS
nav ul li a{
color:#000;
border-bottom: 1px solid #FFBE08;
-webkit-transition: border-bottom linear 1s;
-moz-transition: border-bottom linear 1s;
-o-transition: border-bottom linear 1s;
transition: border-bottom linear 1s;
text-decoration:none;
}
nav ul li a:hover{ color:#000; border-bottom:1px solid #000; }
#2
0
Try this:
ul#footer_menu li a{
color: #848587 !important;
}
#3
-1
Take a look at Fiddle it works completely fine
看看Fiddle它完全没问题
ul#footer_menu li a{
color: red;
}
ul#footer_menu li a:hover {
color: #FFFFFF;
}