渐变仅在IE 8中显示为白色到黑色



我有一个渐变,我已经应用于div,它是非常浅的灰色到略深的灰色,它适用于除IE8以外的所有浏览器。 我无法访问 css,所以我不得不使用 jquery 应用这些样式,但它们似乎适用于所有其他浏览器,所以我不确定为什么它不适用于 IE。 这是代码:

$(document).ready(function() {
//Build your CSS.
var gradient1 = {
    "background": "-moz-linear-gradient(top,  #fbfbfb 0%, #f4f4f5 100%)"
};
var gradient2 = {
    "background": "-webkit-linear-gradient(top,  #fbfbfb 0%,#f4f4f5 100%)"
};
var gradient3 = {
    "background": "-o-linear-gradient(top,  #fbfbfb 0%,#f4f4f5 100%)"
};
var gradient4 = {
    "background": "-ms-linear-gradient(top,  #fbfbfb 0%,#f4f4f5 100%); /* IE10+ */ background: linear-gradient(to bottom,  #fbfbfb 0%,#f4f4f5 100%)"
};
var gradient5 = {
    "filter": "progid:DXImageTransform.Microsoft.gradient(startColorstr=#fbfbfb, endColorstr=# f4f4f5)"
};
var gradient6 = {
    "-ms-filter": "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#fbfbfb', endColorstr='#f4f4f5')"
};
var blue_background = {
    "background": "#eff5f8"
};

//Apply your CSS to the body tag.  You can enter any tag here, as
//well as ID's and Classes.
$(".gradient_1").css(gradient1);
$(".gradient_2").css(gradient2);
$(".gradient_3").css(gradient3);
$(".gradient_4").css(gradient4);
$(".gradient_5").css(gradient5);
$(".gradient_6").css(gradient6);

$(".blue").css(blue_background);
});

然后我将所有类应用于div,梯度 1-6。div 的 html 是:

<div class="gradient_1 gradient_2 gradient_3 gradient_4 gradient_5 gradient_6"   
style="width: 690px; zoom: 1; display: block; margin-bottom: 15px; height: 100%;  
padding-top: 15px;">

该页面 http://www.brighamandwomens.org/Patients_Visitors/pcs/rehabilitationservices/mock/about.aspx 感谢您对此的任何帮助。

IE

8不支持渐变。 您必须使用单一颜色或提供背景图像

最新更新