在ie8和ie9上的CSS径向渐变 [英] CSS radial gradient on ie8 and ie9

查看:127
本文介绍了在ie8和ie9上的CSS径向渐变的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在ie8和ie9上进行以下工作?

Is there a way to make the following work on ie8 and ie9?

谢谢

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 */

推荐答案

我注意到您在CSS中遇到了一个问题,即您将-moz--ms-前缀加倍了.那些绝对不会那样工作.

I note that you've got a problem in the CSS in the question where you've doubled up the -moz- and -ms- prefixes. Those definitely won't work like that.

忽略这一点,您是对的,在旧版IE中径向渐变是一个问题.实际上,由于IE 9或更早版本不支持CSS渐变,因此在老版本的IE中,CSS渐变通常是有问题的.

Ignoring that, you're right that radial gradients are a problem in old IE. In fact, CSS gradients in general are problematic in old IE versions because CSS gradients are not supported in IE 9 or earlier.

我对IE 6-9中CSS渐变的常规解决方案是 CSS3Pie .

My normal solution to CSS gradients in IE 6-9 is CSS3Pie.

但是对于径向渐变,这还不够,因为CSS3Pie当前不支持径向渐变.有关此内容的更多信息,请参见 css3pie文档.引用:

However for radial gradients this isn't sufficient, because CSS3Pie doesn't currently support radial gradients. See the css3pie documentation for more info on this. To quote:

目前不支持径向渐变;该功能计划在将来的版本中发布(请参阅问题#2),但由于VML奇怪的径向渐变行为,因此可能无法在IE 6-8中实现.

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.

您拥有的另一种选择是使用IE的filter样式(并接受它随附的所有怪异问题和怪癖).即使在这里,径向渐变也很困难,但是这里有一种解决方案可能会有所帮助:

The other option you have is to use IE's filter style, (and accept all the weird issues and quirks that come with it). 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

这篇关于在ie8和ie9上的CSS径向渐变的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆