开发者

IE ignores !important tag in css [closed]

开发者_StackOverflow It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜