0

我用 css 做了一些花哨的按钮,但是在 IE9 中,我的边框不是圆角的。

HTML:

<div id="buttons">
  <a href="#"></a>
  <a href="#"></a>
  <a href="#"></a>
  <a href="#"></a>
  <a href="#"></a>
</div>​

CSS:

#buttons a {
    margin: 2px 4px;
    border-radius: 13px;
    height: 25px;
    width: 25px;
    display: block;
    float: left;
    position: relative;
    background: rgb(178,91,91);
    background: -moz-linear-gradient(top,  rgba(178,91,91,1) 0%, rgba(252,200,200,1) 26%, rgba(89,52,52,1) 51%, rgba(254,254,254,1) 75%, rgba(85,52,54,1) 94%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(178,91,91,1)), color-stop(26%,rgba(252,200,200,1)), color-stop(51%,rgba(89,52,52,1)), color-stop(75%,rgba(254,254,254,1)), color-stop(94%,rgba(85,52,54,1)));
    background: -webkit-linear-gradient(top,  rgba(178,91,91,1) 0%,rgba(252,200,200,1) 26%,rgba(89,52,52,1) 51%,rgba(254,254,254,1) 75%,rgba(85,52,54,1) 94%);
    background: -o-linear-gradient(top,  rgba(178,91,91,1) 0%,rgba(252,200,200,1) 26%,rgba(89,52,52,1) 51%,rgba(254,254,254,1) 75%,rgba(85,52,54,1) 94%);
    background: -ms-linear-gradient(top,  rgba(178,91,91,1) 0%,rgba(252,200,200,1) 26%,rgba(89,52,52,1) 51%,rgba(254,254,254,1) 75%,rgba(85,52,54,1) 94%);
    background: linear-gradient(to bottom,  rgba(178,91,91,1) 0%,rgba(252,200,200,1) 26%,rgba(89,52,52,1) 51%,rgba(254,254,254,1) 75%,rgba(85,52,54,1) 94%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b25b5b', endColorstr='#553436',GradientType=0 );
    box-shadow: 0 0 3px rgba(0,0,0,0.2);
}

#buttons a:after {
    background: #a62434;
    background: -moz-linear-gradient(top,  #ea5160 0%, #a62434 40%, #771b22 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ea5160), color-stop(40%,#a62434), color-stop(100%,#771b22));
    background: -webkit-linear-gradient(top,  #ea5160 0%,#a62434 40%,#771b22 100%);
    background: -o-linear-gradient(top,  #ea5160 0%,#a62434 40%,#771b22 100%);
    background: -ms-linear-gradient(top,  #ea5160 0%,#a62434 40%,#771b22 100%);
    background: linear-gradient(to bottom,  #ea5160 0%,#a62434 40%,#771b22 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#771b22', endColorstr='#ea5160',GradientType=0 );
    box-shadow: inset 0 0 3px rgba(91,22,23,0.5);
    display: block;
    content: '';
    position: absolute;
    height: 21px;
    width: 21px;
    top: 2px;
    left: 2px;
    border-radius: 11px;
}​

演示:http:
//jsfiddle.net/JJqe7/

4

1 回答 1

0

IE9 可能会退回到较旧的渲染引擎,因此不支持边框半径。尝试将以下元添加到您的<head>

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

在此处查看更多信息:ie9 边界半径

于 2012-08-11T09:57:24.387 回答