简体   繁体   English

ie8和ie9上的CSS径向渐变

[英]CSS radial gradient on ie8 and ie9

Is there a way to make the following work on ie8 and ie9? 有没有办法在ie8和ie9上进行以下工作?

Thanks 谢谢

background: -moz-moz-radial-gradient(center top, farthest-side, rgba(175,175,175,0.3) 0%, rgba(255,255,255,0) 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center top, farthest-side, 0px, center top, farthest-side, 100%, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0))); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center top, farthest-side, rgba(175,175,175,0.3) 0%,rgba(255,255,255,0) 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center top, farthest-side, rgba(175,175,175,0.3) 0%,rgba(255,255,255,0) 100%); /* Opera 12+ */
background: -ms-ms-radial-gradient(center top, farthest-side, rgba(175,175,175,0.3) 0%,rgba(255,255,255,0) 100%); /* IE10+ */
background: radial-gradient(farthest-side at center top, rgba(175,175,175,0.3) 0%,rgba(255,255,255,0) 100%); /* W3C */

I note that you've got a problem in the CSS in the question where you've doubled up the -moz- and -ms- prefixes. 我注意到你在问题中你遇到了问题,你把-moz--ms-前缀加倍了。 Those definitely won't work like that. 那些肯定不会那样工作。

Ignoring that, you're right that radial gradients are a problem in old IE. 忽略这一点,你是对的,径向渐变是旧IE中的一个问题。 In fact, CSS gradients in general are problematic in old IE versions because CSS gradients are not supported in IE 9 or earlier. 实际上,CSS渐变在旧IE版本中通常是有问题的,因为IE 9或更早版本不支持CSS渐变。

My normal solution to CSS gradients in IE 6-9 is CSS3Pie . 我在IE 6-9中对CSS渐变的常规解决方案是CSS3Pie

However for radial gradients this isn't sufficient, because CSS3Pie doesn't currently support radial gradients. 但是对于径向渐变,这还不够,因为CSS3Pie目前不支持径向渐变。 See the css3pie documentation for more info on this . 有关详细信息,请参阅css3pie文档 To quote: 报价:

Radial gradients are not supported at this time; 目前不支持径向渐变; this feature is planned for a future release (see issue #2) but it may turn out to be impossible to implement in IE 6-8 due to VML's strange radial gradient behavior. 此功能计划用于将来的版本(请参阅问题#2),但由于VML奇怪的径向渐变行为,可能无法在IE 6-8中实现。

The other option you have is to use IE's filter style, (and accept all the weird issues and quirks that come with it). 另一个选择是使用IE的filter样式,(并接受随之而来的所有奇怪的问题和怪癖)。 Even here, radial gradients are difficult, but there is a solution here that might help: Create a radial gradient for Internet Explorer 6/7/8 即使在这里,径向渐变也很困难,但这里有一个解决方案可能会有所帮助: 为Internet Explorer 6/7/8创建径向渐变

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

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