我在 IE9 中遇到 CSS 渐变问题。我正准备用一张图片来做这件事……我想 UGGHHH 向后移动。
我用过这个网站http://www.colorzilla.com/gradient-editor/创建我的渐变,它说 IE6-9 支持使用这个...
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=0 ); /* IE6-9 */
但它在 IE9 中不显示
这是我的整个 CSS 条目
.orangeButton {
width: 170px;
height: 20px;
padding: 3px 20px;
text-align: center;
color: #fff;
border-radius: 3px;
font-family: Arial;
font-size: 14px;
font-weight: bold;
color: #fff;
text-shadow: 1px 1px #ff4e00;
text-decoration: none;
background: #ffa70f; /* Old browsers */
background: -moz-linear-gradient(top, #ffa70f 1%, #ff810f 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#ffa70f), color-stop(100%,#ff810f)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffa70f 1%,#ff810f 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffa70f 1%,#ff810f 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffa70f 1%,#ff810f 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffa70f 1%,#ff810f 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffa70f', endColorstr='#ff810f',GradientType=0 ); /* IE6-9 */
}
Color Zilla 中没有其他方法可以做到这一点。我已经阅读了可以使用背景图片的地方,这对 IE9 和更早版本是否更好?
最佳答案
支持 IE9(使用 SVG)的完整多站渐变。 向所有具有渐变的元素添加一个“渐变”类,并将以下覆盖添加到您的 HTML 以完成对 IE9 的支持:
<!--[if gte IE 9]>
<style type="text/css">
.gradient {
filter: none;
}
</style>
<![endif]-->
关于html - IE9 渐变不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19167200/