如何从html链接中删除下划线?

时间:2016-12-10 05:38:01

标签: html css

如何从html链接中删除下划线?

2 个答案:

答案 0 :(得分:0)

所有你需要做的就是在CSS中:

a {
  text-decoration: none;
}

答案 1 :(得分:0)

虽然text-decoration: none;会按照你的要求行事,但这里有一个片段可以删除其他奇怪的内容,例如持续的大纲。

a.nostylelink {
  outline: none !important;
  text-decoration: none !important;
  color: inherit;
}
a.nostylelink:active,
a.nostylelink:visited,
a.nostylelink:link {
  color: inherit;
  text-decoration: none !important;
  outline: none !important;
}
a.nostylelink:hover {
  text-decoration: none !important;
  outline: none !important;
}

要使用它,只需将课程nostylelink添加到<a>标记,或者像这样;

<a class="nostylelink" href=""></a>

相关问题