解決方案是將梯度嵌套在另一個元素中,邊界半徑和溢出。 這並不理想,但它的所有CSS。沒有黑客。
除此之外,使用背景圖像對ie來說工作得非常好。
<div class="corner">
<div class="grad">button</div>
</div>
<style>
.corner,
.grad{
height:50px;
width:250px;
}
.corner{
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
overflow:hidden;
}
.grad{
border:1px #659300 solid;
background: #659300; /* old browsers */
background: -moz-linear-gradient(top, #659300 0%, #6F9B00 50%, #528200 51%, #6CA501 100%); /* firefox */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#659300), color-stop(50%,#6F9B00), color-stop(51%,#528200), color-stop(100%,#6CA501)); /* webkit */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#b1cc00', endColorstr='#518e00',GradientType=0); /* ie */
}
</style>
這是隻在IE9?如果沒有,你可以發佈一些CSS? – 2011-01-10 23:42:37
當然,它只在IE9中。 IE8不支持`border-radius`。 – SLaks 2011-01-10 23:45:42