无论如何(在CSS中)避免在页面中引入的文本和链接的下划线..?


当前回答

使用CSS。这删除了a和u元素的下划线:

a, u {
  text-decoration: none;
}

有时你需要覆盖元素的其他样式,在这种情况下,你可以在你的规则上使用!important修饰符:

a {
  text-decoration: none !important;
}

其他回答

<u>

是一个已弃用的标记。

使用……

<span class="underline">My text</span>

一个CSS文件包含…

span.underline
{
    text-decoration: underline;
}  

或者只是……

<span style="text-decoration:underline">My Text</span>

使用CSS。这删除了a和u元素的下划线:

a, u {
  text-decoration: none;
}

有时你需要覆盖元素的其他样式,在这种情况下,你可以在你的规则上使用!important修饰符:

a {
  text-decoration: none !important;
}

css是

text-decoration: none;

and

text-decoration: underline;

这将删除您的颜色以及锚标签存在的下划线

a {
  text-decoration: none;
}

a:hover {
  color: white;
  text-decoration: none;
  cursor: pointer;
}

如果你只是想从锚链接中删除下划线,最好的选择-

#content a {
    text-decoration-line:none;
}

这将删除下划线。

此外,您也可以使用类似的语法来操作其他样式,使用-

text-decoration: none;
text-decoration-color: blue;
text-decoration-skip: spaces;
text-decoration-style: dotted;

希望这能有所帮助!

附注:这是我第一次回答!