如何阻止Chrome覆盖我设置的CSS链接颜色? [英] How do I stop Chrome overriding a CSS link colour I set?

查看:883
本文介绍了如何阻止Chrome覆盖我设置的CSS链接颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个网站范围的CSS,用于设置链接的颜色。这在IE上工作正常,但在Chrome中,链接有一种紫色,几乎看不到我的背景。



检查开发者工具,我看到我的全球颜色被划掉,而活跃规则如下:



Hi,

I have a site-wide CSS that sets the colour for links. This works fine on IE, but in Chrome, the links have a purple colour that is almost invisible against my background.

Checking in Developer Tools, I see that my global colour is crossed out and instead the active rule is as follows:

a:-webkit-any-link { color: -webkit-link; }





我不明白为什么我的规则不是具有最高特异性的规则。我认为浏览器中内置的默认规则具有最低优先级,但这个规则似乎高于我的规则。



有没有人知道这里发生了什么,以及 - 更重要的是 - 我怎么能解决它?



亲切的愿望~Patrick



I don't see why my rule isn't the one with the highest specificity. I thought default rules built into the browser had the lowest priority, but this one appears to be higher than my rule.

Does anyone have any idea what's happening here, and - more importantly - how I can fix it?

Kind wishes ~ Patrick

推荐答案

Patrick,



你可以在你的css文件中使用这一行

Hi Patrick,

You could use this line in your css file
a:-webkit-any-link { color: -webkit-link !important; }



这将坚持浏览器的优先权。

查看此图片 [ ^ ]

希望这对你有所帮助。



此致,

RK


this will insist priority to the browser.
See this image[^]
Hope this helps you a bit.

Regards,
RK


这篇关于如何阻止Chrome覆盖我设置的CSS链接颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆