简体   繁体   English

径向梯度CSS问题在IE

[英]radial gradient css issue in ie

I have used the following css for radial gradient. 我已将以下CSS用于径向渐变。

background-image: -moz-radial-gradient(50% 0 , rgba(0, 0, 0, 0.35), rgba(255, 255, 255, 0)), -moz-radial-gradient(50% 100% , rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0));
   background-image:  -ms-linear-radial-gradient(50% 0 , rgba(0, 0, 0, 0.60), rgba(255, 255, 255, 0)), -ms-linear-radial-gradient(50% 100% , rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0));
   background-image: -o-linear-radial-gradient(50% 0 , rgba(0, 0, 0, 0.60), rgba(255, 255, 255, 0)), -o-linear-radial-gradient(50% 100% , rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0));
    background-image: -webkit-radial-gradient(50% 0 , rgba(0, 0, 0, 0.60), rgba(255, 255, 255, 0)), -webkit-radial-gradient(50% 100% , rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0));

It is working fine in firefox and google chrome. 在Firefox和谷歌浏览器中运行正常。 I need the same in IE. 我需要在IE中也一样。 I have extracted the following css from google to work in IE 我已从Google提取以下CSS以在IE中工作

background: linear-gradient(to bottom, #1e5799 0%,#2989d8 50%,#207cca 51%,#7db9e8 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=0 ); /* IE6-9 */

But i don't know how to change the percentages and colors to match the above css. 但我不知道如何更改百分比和颜色以匹配上述CSS。 Any help? 有什么帮助吗?

http://jsfiddle.net/tKjap/ http://jsfiddle.net/tKjap/

Does IE support rgba colors? IE是否支持rgba颜色? If it does, then just replace the hex colors in the copied code with the rgba colors. 如果是这样,则只需将复制代码中的hex颜色替换为rgba颜色。

Ex.) 例)

background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, rgba(255, 255, 255, 0) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='rgba(0, 0, 0, 0.35)', endColorstr='rgba(255, 255, 255, 0)',GradientType=0 ); /* IE6-9 */

Some reading: 一些阅读:

You can get the Gradient CSS as per your requirement and can make also Gradient CSS according to your color requirement. 您可以根据需要获得Gradient CSS ,也可以根据您的颜色要求制作Gradient CSS

http://www.colorzilla.com/gradient-editor/ http://www.colorzilla.com/gradient-editor/

这应该可以帮助您http://davidwalsh.name/css-gradients http://www.webdesignerwall.com/demo/gradient-box.html http://coding.smashingmagazine.com/2010/04/28/css3-互联网浏览器解决方案/

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

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