简体   繁体   English

IE9过滤渐变和边界半径冲突

[英]IE9 filter gradient and border-radius conflict

I'm trying to use gradient effect and border radius on same element, but there is a conflict between them. 我试图在同一个元素上使用渐变效果和边框半径,但它们之间存在冲突。 Gradient works fine, but it makes border radius not working. 渐变工作正常,但它使边框半径不起作用。

here is the script 这是脚本

.selector {
     filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff4317',endColorstr='#891a00');
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
}

I don't want to use any .htc files. 我不想使用任何.htc文件。

Is this known issue between filter and border radius? 这是过滤器和边界半径之间的已知问题吗?

Thanks. 谢谢。

You can use an SVG gradient, here's an example that works in IE9 with a border-radius : http://jsfiddle.net/thirtydot/Egn9A/ 您可以使用SVG渐变,这是一个在IE9中使用border-radius的示例: http//jsfiddle.net/thirtydot/Egn9A/

To generate the SVG gradient, use: http://www.colorzilla.com/gradient-editor/ . 要生成SVG渐变,请使用: http//www.colorzilla.com/gradient-editor/ You don't mention trying to make it work in other browsers/versions of IE, but if that's what you're trying to do (you might be because you're using filter ), use the method described in the "IE9 Support" section. 您没有提及尝试使其在IE的其他浏览器/版本中工作,但如果您正在尝试这样做(可能是因为您正在使用filter ),请使用“IE9支持”中描述的方法部分。

Another site to generate SVG gradients: http://ie.microsoft.com/testdrive/graphics/svggradientbackgroundmaker/default.html 另一个生成SVG渐变的网站: http//ie.microsoft.com/testdrive/graphics/svggradientbackgroundmaker/default.html

Use these classes for border radius and gradient 将这些类用于边框半径和渐变

HTML Code: HTML代码:

<div class="box-radius ">border radius with gradient</div>

CSS Code: 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 */

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当过滤器梯度应用于单元格时,单元格边框在IE9中不显示 - Cell border not showing in IE9 when filter gradient is applied to cells 背景滤镜超出边界半径 - Backdrop Filter extends beyond Border Radius IE9:使用过滤器时链接出现问题 - IE9: issue in a link when use filter 使用background-size的水平渐变条纹在IE9中不起作用 - Horizontal gradient stripe using background-size not working in IE9 IE9,IE10双重浸入CSS不透明度/滤镜 - IE9, IE10 double dipping CSS opacity/filter 在CSS过滤器中等效此梯度代码 - Equivalant of this gradient code in ie css filter 如果存在背景色,则IE8渐变滤镜将不起作用 - IE8 gradient filter not working if a background color exists 在IE9中使用dropshadow过滤器时,如何摆脱文本上的黑色文物 - How to get rid of black artifacts on text when using dropshadow filter in IE9 将 IE 7 和 8 的 CSS 过滤器属性用于渐变以及背景图像会降低图像的不透明度? - Using the CSS Filter Property for IE 7 & 8 for a gradient along with a background image decreased opacity of the image? Microsoft 渐变过滤器导致 IE8 中的水平滚动条无效,带有 HTML5 - Microsoft gradient filter causes inactive horizontal scrollbar in IE8 with HTML5
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM