0

我有这个问题,我的导航链接在悬停时有下划线。我试图放置文本装饰:无。我查看了整个 CSS,但找不到下划线的原因。

所以我使用了萤火虫并检查了它给我下划线的特定位置的css。我得到了这个不是我自己的css。

@font-face {
    font-family: "EB Garamond";
    font-style: normal;
    font-weight: 400;
    src: local("EB Garamond"), local("EBGaramond"), url("http://themes.googleusercontent.com/static/fonts/ebgaramond/v4/kYZt1bJ8UsGAPRGnkXPeFYbN6UDyHWBl620a-IRfuBk.woff") format("woff");
}

我的问题是如何改变这种风格?这是什么风格?

4

3 回答 3

1

The fastest way to solve the problem is to use text-decoration:none !important; in a css selector, preferably a rather specific one.

That css is specifying a custom font to use, specifying where to log it from (http://themes.googleusercontent.com/) and what the default settings, such as font weight, should be when it used. Then any time the font-face is set to EB Garamond it will load those defaults. As that class is listed here it is not responsible for the underlining.

于 2012-07-25T19:39:48.190 回答
0

它可能是覆盖样式的其他任何地方。覆盖它:

a:hover{
    text-decoration:none !important;
}

重要的是告诉浏览器覆盖其他样式表

于 2012-07-25T19:20:58.297 回答
0

如果您不希望链接上有下划线,您还必须将 CSS 更改为 text-decoration:none 锚标记(或其类或 id)本身以及悬停、活动和访问的伪类。像这样:

a, a:visited, a:hover, a:active {
    text-decoration: none;
}

Where you could use the selector like this for a class (where the class is applied to the a tag)

.class, .class:visited, .class:hover, .class:active

or like this for an id (where the a tag has this id)

#id, #id:visited, #id:hover, #id:active
于 2012-07-25T19:23:23.177 回答