【发布时间】:2018-09-13 00:28:57
【问题描述】:
我希望通过使用尽可能少的 css 来创建一个除了光标之外看起来像纯文本的链接。
问题:<a> 有蓝色(悬停时变暗),悬停时也有下划线。我希望它看起来像纯文本(没有下划线的黑色)。
通过使用 Bootstrap 类“text-dark”,我设法摆脱了蓝色。 但是我如何摆脱下划线(文本装饰)不写 css?
.no-underline:hover {
text-decoration: none;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<span>Standard text</sapn>
<hr>
<a href="#">Standard a tag. Different colors and underline on hover</a>
<hr>
<a href="#" class="text-dark">a tag with text-dark class. Note underline on hover</a>
<hr>
<a href="#" class="text-dark no-underline">a tag with text-dark class and css to disable underline on hover</a>
【问题讨论】:
标签: css bootstrap-4