How do I reset or override IE CSS filters?

前端 未结 7 1253
Happy的楠姐
Happy的楠姐 2020-12-07 11:48

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

相关标签:
7条回答
  • 2020-12-07 12:25

    try this:

    filter: -;

    0 讨论(0)
  • 2020-12-07 12:27

    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.

    0 讨论(0)
  • 2020-12-07 12:29

    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

    0 讨论(0)
  • 2020-12-07 12:34

    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)";
    
    0 讨论(0)
  • 2020-12-07 12:34

    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; }
    
    0 讨论(0)
  • 2020-12-07 12:34

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

    0 讨论(0)
提交回复
热议问题