IE ignores !important tag in css
Recently I came across a wierd thing in IE.
It ignores a '!important' tag for CSS attributes.
Does anyone have a workaround for this, except putting it directly as a style attribute inside the DOM?
I do not want to go into the DOM and put styling attributes in it.
I've found the !important
tag will not work in a style if it has previously been used on the style that you are trying to overwrite/update.
For example, if you have:
.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;
}
The secondary colr #fff
won't take affect because of the !important
assigned to the color #ff0000
.
Just an observation/thought.
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.
链接地址: http://www.djcxy.com/p/7208.html下一篇: IE忽略!在CSS中的重要标签