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


当前回答

我在网印中一直被这个问题困扰并解决了。验证的结果。

a {
  text-decoration: none !important;
}

它的工作原理!

其他回答

在我的例子中,有一个关于锚的悬停效应的规则,像这样:

#content a:hover {
  border-bottom: 1px solid #333;
}

当然,文字装饰:没有;在这种情况下也无能为力。 我花了很长时间才发现。

所以:下划线不要与border-bottom混淆。

有时它会被一些渲染UI CSS覆盖。更好的用法:

a.className {
  text-decoration: none !important;
}

使用CSS删除文本装饰。

a {
  text-decoration: none;
}

下划线可以通过称为文本装饰的CSS属性删除。

<style>
    a {
        text-decoration:none;
    }
</style>

如果要删除除a之外元素中文本的下划线,则应使用以下语法。

<style>
    element-name{
        text-decoration:none;
    }
</style>

还有许多其他文本装饰值可以帮助你设计链接。

css是

text-decoration: none;

and

text-decoration: underline;