CSS radial gradient on ie8 and ie9

五迷三道 提交于 2019-12-13 06:27:34

问题


Is there a way to make the following work on ie8 and 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 */

回答1:


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.

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.

My normal solution to CSS gradients in IE 6-9 is 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:

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.

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



来源:https://stackoverflow.com/questions/16102420/css-radial-gradient-on-ie8-and-ie9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!