无法删除 CSS 类 a:悬停背景颜色

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14803503/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 21:37:15  来源:igfitidea点击:

Unable to remove CSS class a: hover background-color

csshyperlinkhoverbackground-colorcss-reset

提问by cunningfox

I've created a CSS class .press-title, however I've been unable to remove the backround color applied on hover.

我创建了一个 CSS 类 .press-title,但是我一直无法删除悬停时应用的背景颜色。

.press-title a:hover { background-color: none; text-decoration: none;}

Ideas?

想法?

Link is towards the bottom of the page:

链接位于页面底部:

http://domdemarcos.com/typography/

http://domdemarcos.com/typography/

EDIT to reflect change made from reply.

编辑以反映回复所做的更改。

回答by Rob Stevenson-Leggett

Try

尝试

.press-title a:hover { background-color: transparent; text-decoration: none; }

回答by mika

Try:

尝试:

background-color:transparent;

回答by ?ime Vidas

Your selector is invalid. Firefox throws this message: Expected identifier for pseudo-class or pseudo-element but found ' '. Ruleset ignored due to bad selector.

您的选择器无效。Firefox 抛出此消息:Expected identifier for pseudo-class or pseudo-element but found ' '. Ruleset ignored due to bad selector.

It should be:

它应该是:

.press-title a:hover