CSS - 为IE设置的渐变 [英] CSS - gradient set for IE
本文介绍了CSS - 为IE设置的渐变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何为IE设置渐变,因为我在尝试,但没有运气,我的工作在chrome,firefox,歌剧,但不是在IE
How do I set gradient for IE, because I was trying but without any luck, I got it working on chrome, firefox, opera but not in IE
html, body {
height: 100%;
background-image: -ms-linear-gradient(top, #BDE25E 0%, #8BB31D 100%);
background-image: -moz-linear-gradient(top, #BDE25E 0%, #8BB31D 100%);
background-image: -o-linear-gradient(top, #BDE25E 0%, #8BB31D 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #BDE25E), color-stop(1, #8BB31D));
background-image: -webkit-linear-gradient(top, #BDE25E 0%, #8BB31D 100%);
background-image: linear-gradient(to bottom, #BDE25E 0%, #8BB31D 100%);
background-repeat: no-repeat;
background-attachment: fixed;
font-family:Tahoma, Geneva, sans-serif;
color:#FFFFFF;
font-size:11px;
}
但是当我在IE中启动它时, 。
But when I launch it in IE, I get white background instead of green gradient.
推荐答案
您没有IE支持的代码。使用 colorzilla 建立跨浏览器渐层:
You have no code in there that IE supports. Use colorzilla to create cross-browser gradients:
background: #bde25e; /* Old browsers */
background: -moz-linear-gradient(top, #bde25e 2%, #8bb31d 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(2%,#bde25e), color-stop(100%,#8bb31d)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #bde25e 2%,#8bb31d 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #bde25e 2%,#8bb31d 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #bde25e 2%,#8bb31d 100%); /* IE10+ */
background: linear-gradient(to bottom, #bde25e 2%,#8bb31d 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bde25e', endColorstr='#8bb31d',GradientType=0 ); /* IE6-9 */
这篇关于CSS - 为IE设置的渐变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文