我注意到这个被服务使用了,效果看起来超级棒
-moz-linear-gradient(center top , #E3EBF3, #D5E1ED) repeat scroll 0 0 transparent
我注意到这个被服务使用了,效果看起来超级棒
-moz-linear-gradient(center top , #E3EBF3, #D5E1ED) repeat scroll 0 0 transparent
像您在问题中一样使用 CSS 属性。添加-moz
,-webkit
前缀,然后使用它无前缀。
IE的filter
属性可以做渐变。这是适当的,但它有效:)
http://www.colorzilla.com/gradient-editor/
使用 modernizr 和一些顶部的 IE 块将类添加到您的 html 标记,以便您可以提供有效的 HTML 和 CSS,以及必要的 hacks 和属性。
例如,在我过去使用的渐变中:
body {
background: #2688cf;
}
.cssgradients body{
background: -moz-linear-gradient(top, #2688cf 0%, #2989d8 12%, #207cca 14%, #62a2d6 18%, #b9d5ea 28%, #ffffff 40%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#2688cf), color-stop(12%,#2989d8), color-stop(14%,#207cca), color-stop(18%,#62a2d6), color-stop(28%,#b9d5ea), color-stop(40%,#ffffff));
background: -webkit-linear-gradient(top, #2688cf 0%,#2989d8 12%,#207cca 14%,#62a2d6 18%,#b9d5ea 28%,#ffffff 40%);
background: -o-linear-gradient(top, #2688cf 0%,#2989d8 12%,#207cca 14%,#62a2d6 18%,#b9d5ea 28%,#ffffff 40%);
background: linear-gradient(top, #2688cf 0%,#2989d8 12%,#207cca 14%,#62a2d6 18%,#b9d5ea 28%,#ffffff 40%);
}
.ie6 body, .ie7 body, .ie8 body, .ie9 body {
background: -ms-linear-gradient(top, #2688cf 0%,#2989d8 12%,#207cca 14%,#62a2d6 18%,#b9d5ea 28%,#ffffff 40%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2688cf', endColorstr='#ffffff',GradientType=0 );
background: linear-gradient(top, #2688cf 0%,#2989d8 12%,#207cca 14%,#62a2d6 18%,#b9d5ea 28%,#ffffff 40%);
}