无论如何(在CSS中)避免在页面中引入的文本和链接的下划线..?
当前回答
<u>
是一个已弃用的标记。
使用……
<span class="underline">My text</span>
一个CSS文件包含…
span.underline
{
text-decoration: underline;
}
或者只是……
<span style="text-decoration:underline">My Text</span>
其他回答
使用css属性,
text-decoration:none;
从链接中删除下划线。
使用CSS删除文本装饰。
a {
text-decoration: none;
}
最简单的选择是:
<a style="text-decoration: none">No underline</a>
当然,混合CSS和HTML(即内联CSS)不是一个好主意,特别是当你到处使用标签的时候。 这就是为什么把它添加到样式表中是一个好主意:
a {
text-decoration: none;
}
甚至是JS文件中的这段代码:
var els = document.getElementsByTagName('a');
for (var el = 0; el < els.length; el++) {
els[el].style["text-decoration"] = "none";
}
css是
text-decoration: none;
and
text-decoration: underline;
我在网印中一直被这个问题困扰并解决了。验证的结果。
a {
text-decoration: none !important;
}
它的工作原理!