我必須將border-radius
CSS屬性應用於按鈕,但僅當瀏覽器不是Internet Explorer 9.否則,我想使用background-image
屬性。我嘗試使用條件註釋將background-image
應用於IE9,但它不起作用(來自「常規」CSS的border-radius
屬性也應用於IE9,而不是background-image
)。僅適用於IE9的CSS,但其他CSS正在申請
如何更改此設置以使其根據瀏覽器版本應用所需的CSS?
/*For IE9*/
<!--[if lte IE 9]>
.PopupBtn
{
background-image: url("../Images/new-btn.png");
height: 28px;
width: 99px;
border-left-width: 0px;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
cursor: pointer;
}
<![endif]-->
/*Style.css(general)*/
.PopupBtn
{
-moz-box-shadow: inset 0px 2px 1px 0px #0d0d0d;
-webkit-box-shadow:inset 0px 2px 1px 0px #0d0d0d;
box-shadow:inset 0px 2px 1px 0px #0d0d0d;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #fffcff), color-stop(1, #000000));
background:-moz-linear-gradient(center top, #fffcff 5%, #000000 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcff', endColorstr='#000000');
background-color:#fffcff;
-moz-border-radius:22px;
-webkit-border-radius:22px;
border-radius:22px;
display:inline-block;
color:#fcfcfc;
font:bold 13px trebuchet ms;
text-decoration:none;
text-shadow:1px 0px 0px #000000;
min-width:90px;
height:30px;
cursor:pointer;
border-style:none;
}
[點擊這裏](http://stackoverflow.com/questions/9601775/conditional-css-in-css-not-working/9601850#9601850),看看這應該是有用的類似計算器的問題。 – Lokerim