0

我在 IE9 中遇到 CSS 渐变问题。我正准备用一张图片来做这件事……我猜是向后移动。

我使用这个网站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 及之前的版本是否更有效?

4

1 回答 1

2

Support for full multi-stop gradients with IE9 (using SVG). Add a "gradient" class to all your elements that have a gradient, and add the following override to your HTML to complete the IE9 support:

<!--[if gte IE 9]>
  <style type="text/css">
    .gradient {
       filter: none;
    }
  </style>
<![endif]-->
于 2013-10-03T19:12:43.430 回答