rgba background with IE filter alternative: IE9 renders both!

后端 未结 5 790
故里飘歌
故里飘歌 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条回答
  •  误落风尘
    2020-12-15 08:07

    The simplest and most reliable method for filter: compatibility I've found uses the code http://www.colorzilla.com/gradient-editor/ generates:

    
    

    Then you add a gradient CSS class to the element that needs it. And that's it.

    Although conditional comments are still a bit of a hack, in my opinion they're less so than universal selectors or the likes of :not and don't have the performance risks.

    Remember that Microsoft dropped conditional comments from IE10 and above, but you should almost never need them for those versions.

    I wouldn't trust IETester either; download a virtual machine with proper IE9 on from https://www.modern.ie/en-gb - it's free; all you need is time and disk space (keep the original download so when it expires you can just reinstall.)

提交回复
热议问题