2
我正在使用CSS在元素上放置渐变和背景图像。我开始去Colorzilla的渐变,它给了我这个。如何在Internet Explorer中加入背景图像和渐变
background: rgb(250,250,250);
background: -moz-linear-gradient(left, rgba(250,250,250,1) 0%, rgba(236,236,236,1) 100%);
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(250,250,250,1)), color-stop(100%,rgba(236,236,236,1)));
background: -webkit-linear-gradient(left, rgba(250,250,250,1) 0%,rgba(236,236,236,1) 100%);
background: -o-linear-gradient(left, rgba(250,250,250,1) 0%,rgba(236,236,236,1) 100%);
background: -ms-linear-gradient(left, rgba(250,250,250,1) 0%,rgba(236,236,236,1) 100%);
background: linear-gradient(to right, rgba(250,250,250,1) 0%,rgba(236,236,236,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa', endColorstr='#ececec',GradientType=1);
这适用于所有主要的浏览器,包括Internet Explorer(至少在IE9中)。
然后我手动添加背景图像。
background: url('/public/src/images/features_arrow_fade.png') no-repeat 260px center, rgb(250,250,250);
background: url('/public/src/images/features_arrow_fade.png') no-repeat 260px center, -moz-linear-gradient(top, rgba(250,250,250,1) 0%, rgba(236,236,236,1) 100%);
background: url('/public/src/images/features_arrow_fade.png') no-repeat 260px center, -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(250,250,250,1)), color-stop(100%,rgba(236,236,236,1)));
background: url('/public/src/images/features_arrow_fade.png') no-repeat 260px center, -webkit-linear-gradient(top, rgba(250,250,250,1) 0%,rgba(236,236,236,1) 100%);
background: url('/public/src/images/features_arrow_fade.png') no-repeat 260px center, -o-linear-gradient(top, rgba(250,250,250,1) 0%,rgba(236,236,236,1) 100%);
background: url('/public/src/images/features_arrow_fade.png') no-repeat 260px center, -ms-linear-gradient(top, rgba(250,250,250,1) 0%,rgba(236,236,236,1) 100%);
background: url('/public/src/images/features_arrow_fade.png') no-repeat 260px center, linear-gradient(to bottom, rgba(250,250,250,1) 0%,rgba(236,236,236,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa', endColorstr='#ececec',GradientType=0);
这正确地显示除IE以外的所有主流浏览器中的图像渐变。 IE只显示渐变。我怎样才能让它在IE中工作呢?我愿意使用jQuery,如果它会帮助!