简体   繁体   English

CSS3 Border-Radius和IE9

[英]CSS3 Border-Radius and IE9

I have CSS3 gradient that I've generated with ColorZilla. 我有使用ColorZilla生成的CSS3渐变。 I'm pretty sure what's causing the problem is the DATA URI. 我很确定导致问题的是数据URI。 Here's my fiddle: http://jsfiddle.net/cY7Lp/ . 这是我的小提琴: http : //jsfiddle.net/cY7Lp/

In WebKit & Firefox, the corners are rounded as they should be, but in IE9, the corners are rounded and the gradient bleeds outside them, I don't want the gradient to bleed outside the corners. 在WebKit和Firefox中,应将圆角修圆,但在IE9中,应将圆角修圆,并且渐变会在其外部渗出,我不希望渐变在圆角外渗出。 Does anybody know why it happens? 有人知道它为什么会发生吗?

---Edit--- - -编辑 - -

I forgot to mention, this does not happen with inline elements, only block elements. 我忘了提一下,内联元素不会发生这种情况,只有块元素会发生这种情况。

It has nothing to do with your SVG image or its data URI, but it has to do with your filter . 它与您的SVG图像或其数据URI无关,但它与您的filter Effects generated by the filter property, which you're using, do not get clipped by border-radius , and often overlap certain other things such as background images. 您正在使用的filter属性生成的效果不会被border-radius剪切,并且通常会与某些其他内容(如背景图像)重叠。

Whether this is a real bug or an unintended side effect, I don't know, but that's the cause in IE9, as it doesn't implement CSS3 gradients — only IE10 does. 我不知道这是真正的错误还是意外的副作用,但这就是IE9的原因,因为它没有实现CSS3渐变-只有IE10可以实现。

Since you're using an SVG image anyway, you can easily fall back to that instead of using filter . 由于您无论如何都在使用SVG图像,因此您可以轻松地使用SVG图像,而不是使用filter

Border radius issue seems to be discussed here: 边界半径问题似乎在这里讨论:

Support for "border-radius" in IE 在IE中支持“边界半径”

... so, likely it is that your browser is rendering in legacy mode. ...因此,很可能是您的浏览器以旧版模式呈现。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM