rgba background with IE filter alternative: IE9 renders both!

后端 未结 5 792
故里飘歌
故里飘歌 2020-12-15 07:42

I\'m trying use make a div\'s background transparent using a mixture of CSS3 rgba() and microsoft\'s filter property like this:

div         


        
5条回答
  •  旧时难觅i
    2020-12-15 08:04

    This seems to work for me (not fully tested in all versions). According to the discussions in this blog the :root selector is only available in IE9 and thus the code below can be written to remove all filter settings in IE9.

    :root *
    {
        filter: progid:DXImageTransform.Microsoft.gradient(enabled='false') !important;
    }
    

    Edit: !important needed to make sure it works in all places.

提交回复
热议问题