!重写覆盖 [英] !important Overridden

查看:102
本文介绍了!重写覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用JQuery手机,我想让所有的文字在我的应用程序是紫色的。我这样做: color:#7A68AE!important; 在我的css的正文 b
$ b

然后我试着在firebug中调试它,发现我的!important 被覆盖。



这是怎么回事?不是!important 应该覆盖一切?



注意固定的问题,我只是真的很好奇为什么!important 没有工作

解决方案

请参阅特定性上的规范。虽然!important 应该覆盖,可能由于其携带的重量,内联样式可能会覆盖此。





另请参阅!important rules


I am using JQuery mobile and I want all of the text to be purple on my application. I did this: color: #7A68AE !important; in my body section of my css.

I then tried to debug it in firebug and noticed that my !important was overridden.

How is this possible? Isn't !important supposed to overwrite everything else?

Note I have already fixed the problem, I was just really curious about why !important didn't work

解决方案

Take a look at the spec on specificity. Though !important should override, it's possible an in-line style may override this due to the weight it carries.

Without seeing an example I can't be 100% positive, however.

See Also !important rules

这篇关于!重写覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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