无论如何(在CSS中)避免在页面中引入的文本和链接的下划线..?
当前回答
这将删除您的颜色以及锚标签存在的下划线
a {
text-decoration: none;
}
a:hover {
color: white;
text-decoration: none;
cursor: pointer;
}
其他回答
使用CSS删除文本装饰。
a {
text-decoration: none;
}
不要忘记使用link标记来包含样式表
http://www.w3schools.com/TAGS/tag_link.asp
或者将CSS包含在网页的样式标签中。
<style>
a { text-decoration:none; }
p { text-decoration:underline; }
</style>
我不建议在除链接之外的任何地方使用下划线,下划线通常被接受为可点击的东西。如果它不可点击,就不要下划线。
CSS基础知识可以在w3schools学习
这将删除您的颜色以及锚标签存在的下划线
a {
text-decoration: none;
}
a:hover {
color: white;
text-decoration: none;
cursor: pointer;
}
<u>
是一个已弃用的标记。
使用……
<span class="underline">My text</span>
一个CSS文件包含…
span.underline
{
text-decoration: underline;
}
或者只是……
<span style="text-decoration:underline">My Text</span>
当你想将一个锚标记简单地用作一个链接而不添加样式(如悬停时的下划线或蓝色)时,在锚标记中添加class="no-style"。然后在全局样式表中创建类no-style。
.no-style {
text-decoration: none !important;
}
这有两个好处。
它不会影响所有的锚标记,只会影响那些添加了“no-style”类的锚标记。 它将覆盖任何其他可能阻止将文本装饰设置为none的样式。