How do I reset or override IE CSS filters?

CssFilterInternet Explorer

Css Problem Overview


I'm using the proprietry MS 'filter' property to try and create a non ugly equivalent to css3 text-shadow and box-shadow;

I was actually doing really well until I hit this problem. It looks like when I apply a filter to a div inside another div which also has a filter the filter effects end up being combined on the child object.

I've tried using filter:none; to do a reset but no joy. I've also tried different variations on the syntax, ie "-ms-filter: 'progid:...Glow()'", "filter: progid:...Glow()", "filter: Glow()", etc..

Testing in IE8

Css Solutions


Solution 1 - Css

There is boolean attribute enabled, for which you can set false or true http://msdn.microsoft.com/en-us/library/ms532997%28v=vs.85%29.aspx

Example:

-ms-filter: "progid:DXImageTransform.Microsoft.gradient(enabled=false)";

Solution 2 - Css

The -ms-filter property is a non-standard, browser-specific CSS entry and as such requires that its parameter is enclosed with quotation marks. So -ms-filter: "none" will work just fine.

Solution 3 - Css

try this:

filter: -;

Solution 4 - Css

I've had some success by positioning the children absolute or relative. This didn't seem to work earlier though so it may break again once I get more complicated

I think once a parent has a filter applied all of it's children essentially become directx surfaces internally. You can still select text but it lags. I think text selection is a hack which makes each letter a seperate surface. It's a shitty mess which goes a long way to explaining why the browser in general and filters in particular are so buggy.

Solution 5 - Css

If you're using HTML5 you may want to go down the route of using

<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="ie6 oldie"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="ie7 oldie"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="ie8 oldie"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html lang="en" class="gtie9 modern">
<!--<![endif]-->

and in your CSS use something like:

.ie9 .element {filter: none; }

Solution 6 - Css

Have you tried to enable/disable the filter(s)?

Solution 7 - Css

I've found the best way is display:inline-block (applying white-space:nowrap to the container). But it seems to work bad with IE7 and lower

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSpliFFView Question on Stackoverflow
Solution 1 - Cssel22orView Answer on Stackoverflow
Solution 2 - CssPink DuckView Answer on Stackoverflow
Solution 3 - CssbrowzahView Answer on Stackoverflow
Solution 4 - CssSpliFFView Answer on Stackoverflow
Solution 5 - CssJohn CView Answer on Stackoverflow
Solution 6 - CssanddoutoiView Answer on Stackoverflow
Solution 7 - CssmazzView Answer on Stackoverflow