【发布时间】:2016-03-11 02:24:40
【问题描述】:
我正在尝试从 <a> 标记中删除所有链接样式。我已经尝试了各种各样的东西,但没有任何效果。我可以让下划线消失,但访问过的链接仍然保持不同的颜色。简单的解决方法是预先设置文本的颜色(并且可以),但我不希望这样。我在这里复制了这个问题:https://jsfiddle.net/qod4dz5x/
我假设这与我在 <a> 标记中包含 <h2> 标记有关?
<a href="http://google.com"><h2>
Google
</h2></a>
a:link {
text-decoration: none !important;
}
a:visited {
text-decoration: none !important;
}
a:hover {
text-decoration: none !important;
}
a:active {
text-decoration: none !important;
}
我错过了什么?感谢您提供任何有用的意见。
【问题讨论】:
-
text-decoration只是去掉了下划线,而不是颜色。 -
但不应该 a:visited text-decoration:none 基本上否认任何 textdecoration 吗?
-
是的,但
text-decoration只处理下划线。 -
废话。细则……谢谢!
标签: javascript html css text-decorations