Should I use the SVG gradients generated by Colorzilla for IE9?

前端 未结 2 1698
难免孤独
难免孤独 2021-02-15 16:20

I\'ve found http://www.colorzilla.com/gradient-editor/ to be great for generating CSS3 gradients. However, there\'s one thing about it which would be great if someone could clar

2条回答
  •  旧巷少年郎
    2021-02-15 16:54

    IE9 does support IE6-8 filters although IE10 will not. You are right that IE9 does not support CSS3 gradients but IE10 will do so.

    Since IE9 does support IE6-8 filters colorzilla needs to turn off the IE6-8 filter when you put the SVG filter on the object. The IE6-8 filter is set using a filter property unlike the css filters that are set using the background property. The addition therefore turns off the duplicate IE6-8 filter on IE9. Given the different property names the last selector matches rule does not apply.

    This code should be faster than regular image fallback as the SVG code can be hardware accelerated. The SVG code won't affect other browsers as the last selector matches, that's why the legacy browser line is at the top.

提交回复
热议问题