我有一个绿色按钮,我已经为它生成了这个 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,它使用 linear-gradient
而不是 filter
。
background-image: linear-gradient(to bottom, #B8E356,#A5BB52);
应该这样做。
关于internet-explorer - 为什么我的绿色按钮在 IE 中显示为白色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19120240/