IE忽略!重要的标签在css [英] IE ignores !important tag in css
问题描述
最近我在IE中遇到了一个奇怪的东西。
Recently I came across a wierd thing in IE.
它忽略了CSS属性的一个'!important'标签。
It ignores a '!important' tag for CSS attributes.
有没有人有一个解决方法,除非直接作为一个样式属性在DOM内?
Does anyone have a workaround for this, except putting it directly as a style attribute inside the DOM?
我不想进入DOM和
推荐答案
我发现了!important
例如,如果您有:
.example{
color:#ff0000 !important;
}
例如,如果使用媒体查询,并在浏览器缩小时告诉样式更改:
And, say for example, if your using Media Queries and tell the style to change upon the browser being reduced in size:
.example{
color:#fff !important;
}
次要colr #fff
将不会生效,因为!important
分配给颜色#ff0000
。
The secondary colr #fff
won't take affect because of the !important
assigned to the color #ff0000
.
只是一个观察/想法。
很难猜出问题的原因。对于SO的用户真正帮助您,您必须提供直播链接,示例代码 jsfiddle.net 或在问题中发布 HTML 和 CSS 。
It's pretty hard to guess what is causing the issue. For the users of SO to really help you, you will have to either supply a live link, sample code on jsfiddle.net or post your HTML and CSS in the question.
这篇关于IE忽略!重要的标签在css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!