Why is webkit radial gradient not working in Safari?

血红的双手。 提交于 2019-12-23 12:33:11

问题


This is working in Chrome but not in Safari:

background: -webkit-radial-gradient(center, ellipse cover, #fdfdfd, #d3d3d3);

How can I fix it for Safari?


回答1:


Try using for Safari:

background: -webkit-gradient( radial, <point>, <radius>, <point>, <radius>[, <stop>]* ) <color>;

Examples and more explanation can be found here: http://www.the-art-of-web.com/css/radial-gradients/




回答2:


It doesn't even work correctly in Chrome, as it shows a circular gradient, not an elliptical one. It does work correctly in Webkit nightlies.

The reason it doesn't work in Safari is that the syntax hasn't propagated yet to a stable version of Safari. Eventually it will. You need to learn patience my young padawan :)

For now, you may use -webkit-gradient, but always include the -webkit-radial-gradient equivalent after it. And while we're at it, don't forget the other prefixes too (-o-,-moz-,-ms-)



来源:https://stackoverflow.com/questions/5840861/why-is-webkit-radial-gradient-not-working-in-safari

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