这是我的代码,它不适用于任何版本的IE -
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.1)), color-stop(100%,rgba(255,255,255,0))), url("../img/archi.png") repeat 0 0;
background: -moz-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.1)), color-stop(100%,rgba(255,255,255,0))), url("../img/archi.png") repeat 0 0;
background: gradient(to linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.1)), color-stop(100%,rgba(255,255,255,0))), url("../img/archi.png") repeat 0 0;
background: -o-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.1)), color-stop(100%,rgba(255,255,255,0))), url("../img/archi.png") repeat 0 0;
答案 0 :(得分:0)
CSS3渐变背景仅适用于IE10和11中的-ms-
前缀。 http://caniuse.com/#search=gradient但是,您可以在其下方使用非标准渐变filter
。
我建议使用以下内容生成渐变http://www.colorzilla.com/gradient-editor/
它将为您提供导入当前CSS的选项,以生成相对交叉浏览器兼容的输出。
但是,在编写渐变的方式上会出现一些语法错误,并且应该对它们进行排序,以使符合最大标准的符号在列表中排在最后(MS的过滤器不能承受)。这是他们应该做的:
background: url("../img/archi.png") repeat 0 0; /* fallback for gradient */
background: -moz-linear-gradient(top, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%), url("../img/archi.png") repeat 0 0; /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.1)), color-stop(100%,rgba(255,255,255,0))), url("../img/archi.png") repeat 0 0; /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(255,255,255,0.1) 0%,rgba(255,255,255,0) 100%), url("../img/archi.png") repeat 0 0; /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(255,255,255,0.1) 0%,rgba(255,255,255,0) 100%), url("../img/archi.png") repeat 0 0; /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(255,255,255,0.1) 0%,rgba(255,255,255,0) 100%), url("../img/archi.png") repeat 0 0; /* IE10+ */
background: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%,rgba(255,255,255,0) 100%), url("../img/archi.png") repeat 0 0; /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1affffff', endColorstr='#00ffffff',GradientType=0 ); /* IE6-9 */