IE中的背景渐变和过滤器

时间:2016-05-19 05:52:00

标签: css internet-explorer

为什么以下代码在IE中不起作用?

渐变代码在IE中不起作用

background: -webkit-linear-gradient(#0B282F, white);
background: -o-linear-gradient(#0B282F, white);
background: -moz-linear-gradient(#0B282F, white);
background: linear-gradient(#0B282F, white);

过滤器在IE中无效。

filter: drop-shadow(5px 5px 100px #fff);;
-webkit-filter: drop-shadow(5px 5px 100px #fff);
filter: drop-shadow(5px 5px 100px #fff);
-o-filter: drop-shadow(5px 5px 100px #fff);

2 个答案:

答案 0 :(得分:1)

参考:http://caniuse.com/#search=filterhttp://caniuse.com/#search=gradient

IE 9,8不支持渐变。 IE 11,9,8不支持过滤属性。 在EDGE中,需要在"启用CSS过滤器属性"下启用它。标志。

答案 1 :(得分:0)

尝试使用IE中的渐变颜色可能会帮助你

filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0b282f', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */