IE9圆角和CSS背景渐变一起生活吗?
|
我在IE9中遇到了一件奇怪的事情,试图显示背景渐变。
基本上,我将多个类应用于容器对象。
<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]-->
那带回了我的角落,但渐变消失了。
没有找到相关结果
已邀请:
5 个回复
抢垢洛韧
并为.corners隐藏溢出
我建议使用这种类似Photoshop的工具来创建跨浏览器的渐变:http://www.colorzilla.com/gradient-editor/ 并创建边界半径: http://border-radius.com/
熊融炭臀陛
块。 只需在样式声明中放入所有3(4,如果您同时包含两个IE)规则,浏览器将仅选择他们理解的规则。 一个例子:
还应注意,仅当元素ѭ8if时,IE中的渐变才会起作用(请参阅:http://reference.sitepoint.com/css/haslayout)
泪琉踞檄
邵酮
步骤: 通过行为包括PIE.htc 像往常一样添加边框半径(border-radius:10px;) 添加特殊的-pie-background属性:(-pie-background:linear-gradient(top,#8cb2d1 0%,#4080b3 42%);)
烫珊