这已被问过几次,但他们已经有几年了,我想知道是否有更好的方法来解决这个问题。下面的 CSS:
.defaultButton {
background: #90c8eb;
background-image: -webkit-linear-gradient(top, #90c8eb, #0b85d1);
background-image: -moz-linear-gradient(top, #90c8eb, #0b85d1);
background-image: -ms-linear-gradient(top, #90c8eb, #0b85d1);
background-image: -o-linear-gradient(top, #90c8eb, #0b85d1);
background-image: linear-gradient(to bottom, #90c8eb, #0b85d1);
-webkit-border-radius: 5;
-moz-border-radius: 5;
border-radius: 5px;
font-family: Arial;
color: #ffffff;
font-size: 0.800em;
font-weight: none;
padding: 7px 14px 7px 16px;
border: solid #6f92a8 1px;
}
linear-gradient
在 Chrome、Firefox 和 Safari 中工作正常,但在 IE 9 中不起作用。我找到了一些 css hack 网站,但它们没有工作。一个提到做:
background-image: -webkit-linear-gradient(top, #90c8eb/9, #0b85d1/9);
添加 /9
无效,\0/
也无效。不确定我是否用错了它们,但到目前为止我没能成功。
最佳答案
你可以试试:
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#90c8eb', endColorstr='#0b85d1', GradientType=0);
关于css - 线性渐变在 Internet Explorer 9 和过滤器 : progid: is not working 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35993278/