0

我有一个绿色按钮,我为它生成了这个 css:

.lime_button {
    -moz-box-shadow:inset 0px 1px 0px 0px #d9fbbe;
    -webkit-box-shadow:inset 0px 1px 0px 0px #d9fbbe;
    box-shadow:inset 0px 1px 0px 0px #d9fbbe;
    background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #b8e356), color-stop(1, #a5bb52));
    background:-moz-linear-gradient(center top, #b8e356 5%, #a5bb52 100%);
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#b8e356', endColorstr='#a5bb52');
    background-image: -moz-linear-gradient(top, #b8e356 0%, #a5bb52 100%);
    background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#B8E356), to(#A5BB52));
    background-color:#b8356;
    -webkit-border-top-left-radius:0px;
    -moz-border-radius-topleft:0px;
    border-top-left-radius:0px;
    -webkit-border-top-right-radius:0px;
    -moz-border-radius-topright:0px;
    border-top-right-radius:0px;
    -webkit-border-bottom-right-radius:0px;
    -moz-border-radius-bottomright:0px;
    border-bottom-right-radius:0px;
    -webkit-border-bottom-left-radius:0px;
    -moz-border-radius-bottomleft:0px;
    border-bottom-left-radius:0px;
    text-indent:0;
    display:inline-block;
    color:#ffffff;
    font-family:Arial;
    font-size:17px;
    font-weight:bold;
    font-style:normal;
    height:50px;
    line-height:50px;
    width:300px;
    text-decoration:none;
    text-align:center;
    text-shadow:1px 1px 0px #86ae47;
}
.lime_button:hover {
    background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #a5cc52), color-stop(1, #b8e356));
    background:-moz-linear-gradient(center top, #a5cc52 5%, #b8e356 100%);
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#a5cc52', endColorstr='#b8e356');
    background-color:#a5cc52;
}
.lime_button:active {
    position:relative;
    top:1px;
}

Chrome中它看起来不错:

铬渲染

但是在IE10中它是白色的:

IE10 渲染

4

2 回答 2

4

您似乎正在使用 IE10,它使用linear-gradient而不是filter.

background-image: linear-gradient(to bottom, #B8E356,#A5BB52);

应该这样做。

于 2013-10-01T15:33:47.310 回答
0

使用http://www.colorzilla.com/gradient-editor/生成具有跨浏览器兼容性的渐变。

于 2013-10-01T17:07:19.743 回答