这是我的导航中的一个链接:
<li><a href="#live-now" class="navBtn"><span id="navLiveNow" class="white innerShadow textShadow">Live Now</span></a></li>
我的css中还包含以下内容:
a { text-decoration: none; }
a:visited { text-decoration: none; }
a:hover { text-decoration: none; }
a:focus { text-decoration: none; }
a:hover, a:active { text-decoration: none; }
但是链接仍然显示在可怕的蓝色/紫色访问的/hover html默认设置中。我做错了什么?
发布于 2012-04-25 17:30:21
您需要覆盖颜色:
a { color:red } /* Globally */
/* Each state */
a:visited { text-decoration: none; color:red; }
a:hover { text-decoration: none; color:blue; }
a:focus { text-decoration: none; color:yellow; }
a:hover, a:active { text-decoration: none; color:black }
发布于 2012-04-25 17:38:55
将颜色#000
定义为像您一样,并像这样修改您的css
.navBtn { text-decoration: none; color:#000; }
.navBtn:visited { text-decoration: none; color:#000; }
.navBtn:hover { text-decoration: none; color:#000; }
.navBtn:focus { text-decoration: none; color:#000; }
.navBtn:hover, .navBtn:active { text-decoration: none; color:#000; }
或者这个
li a { text-decoration: none; color:#000; }
li a:visited { text-decoration: none; color:#000; }
li a:hover { text-decoration: none; color:#000; }
li a:focus { text-decoration: none; color:#000; }
li a:hover, .navBtn:active { text-decoration: none; color:#000; }
发布于 2019-06-12 03:32:56
<a href="https://www." style="color: inherit;"target="_blank">
对于CSS内联样式,这对我来说是最好的。
https://stackoverflow.com/questions/10312857
复制相似问题