2014-01-06 43 views
0

嗯,我试图使用一个简单的渐变,它在大多数浏览器上显示得非常好。然而,在我的笔记本电脑版本11上的Internet Explorer中;目前梯度应该是什么都不是空的空间。我认为这是在浏览器上显示渐变的正确方法,并且我缺少一些东西?CSS渐变消失在Internet Explorer中

这里是我的梯度:

background-image: -moz-linear-gradient(bottom, #292929 0%, #292929 50%, #333 50%, #333 100%); 
background-image: -o-linear-gradient(bottom, #292929 0%, #292929 50%, #333 50%, #333 100%); 
background-image: -webkit-linear-gradient(bottom, #292929 0%, #292929 50%, #333 50%, #333 100%); 
background-image: linear-gradient(bottom, #292929 0%, #292929 50%, #333 50%, #333 100%); 
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#292929', endColorstr='#333333',GradientType=0)!important; 

回答

1

您的linear-gradient语法不正确。使用to top来表示方向性。

http://jsfiddle.net/XHs2g/

background-image: -moz-linear-gradient(bottom, #292929 0%, #292929 50%, #333 50%, #333 100%); 
background-image: -o-linear-gradient(bottom, #292929 0%, #292929 50%, #333 50%, #333 100%); 
background-image: -webkit-linear-gradient(bottom, #292929 0%, #292929 50%, #333 50%, #333 100%); 
background-image: linear-gradient(to top, #292929 0%, #292929 50%, #333 50%, #333 100%); 
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#292929', endColorstr='#333333',GradientType=0)!important; 
+0

这非常谢谢! – mdixon18