我在IE9中遇到了一個奇怪的事情,試圖獲得顯示的背景漸變。IE9圓角和CSS背景漸變共同生活?
基本上我將多個類應用於一個容器對象。
<div class="gradient corners"></div>
使用這個CSS。
.gradient {
background-color: #96A7C5;
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.19, #6C86AD),
color-stop(0.6, #96A7C5)
);
background-image: -moz-linear-gradient(
center bottom,
#75A33A 19%,
#8DC447 60%
);
.corners {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
}
要獲得IE中的梯度,我應用過濾垃圾我.gradient類。
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#8DC447', endColorstr='#75A33A');
這樣,漸變效果很好,但我的圓角消失了。
所以我試圖把過濾器聲明的條件。
<!--[if IE]>
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#8DC447', endColorstr='#75A33A');
<![endif]-->
這會帶回我的角落,但漸變消失。
看一看這太問題:http://stackoverflow.com/questions/4692686/ie9-border-radius-and-background-gradient-bleeding – scurker 2011-05-25 20:10:47
沒有看到,我在快速搜索 - 謝謝,scurker。 – dv8withn8 2011-05-25 20:56:57