开发者

Is it possible to remove a filter from a CSS file on an overriden CSS file?

开发者 https://www.devze.com 2023-03-18 17:30 出处:网络
I have a CSS File that contains a rule like this: .someElement { filter:gray(enabled=true) alpha(opacity=50);

I have a CSS File that contains a rule like this:

.someElement {
    filter:gray(enabled=true) alpha(opacity=50);
    -ms-filter:"gray(enabled=true) alpha(opacity=50)"
}

This rule causes some issues and I would like to remove it. However, making changes to that CSS File is annoying to say the least, and the ideal situation would be to create a secondary CSS file that overri开发者_开发技巧des/removes that rule.

I assume this isn't possible? (without JavaScript or so)


Just add this to your new CSS file and make sure it gets loaded AFTER the original one.

.someElement {
    filter:gray(enabled=false);
    -ms-filter:"gray(enabled=false)";
}

Tested in IE9: http://jsfiddle.net/H7msL/1/


Depends on the context. you can create inline css and override it. or you can create a second css file to override and call it after the first.

Opps didn't see your answer

0

精彩评论

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