【问题标题】:IE9 filter gradient and border-radius conflictIE9 滤镜渐变和边框半径冲突
【发布时间】:2012-05-01 15:11:20
【问题描述】:
我正在尝试在同一元素上使用渐变效果和边框半径,但它们之间存在冲突。渐变效果很好,但它使边界半径不起作用。
这是脚本
.selector {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff4317',endColorstr='#891a00');
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
我不想使用任何.htc 文件。
这是过滤器和边框半径之间的已知问题吗?
谢谢。
【问题讨论】:
标签:
filter
internet-explorer-9
css
【解决方案2】:
将这些类用于边框半径和渐变
HTML 代码:
<div class="box-radius ">border radius with gradient</div>
CSS 代码:
.box-radius {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
/* behavior: url(border-radius.htc); */
}
.gradient {
background-image: -moz-linear-gradient(top, #ff4317, #891a00); /* Firefox 3.6 */
background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #ff4317),color-stop(1, #891a00)); /* Safari & Chrome */
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#ff4317',endColorstr='#891a00'); /* IE6 & IE7 */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#ff4317',endColorstr='#891a00')"; /* IE8 */