为所有其他支持的浏览器转换 -moz-线性梯度
这是我的规则:
#element {
background: -moz-linear-gradient(center top, #FFF 8px, #F2F2F2 24px, #F2F2F2 100%) repeat scroll 0 0 #F2F2F2;
}
我想采用该规则并将其应用于所有支持线性渐变的浏览器。 对于 Chrome、Safari 和... Internet Explorer,此规则的语法是什么样的?
我正在考虑制作一个超级简单的 Web 应用程序,它将采用包含 Mozilla 规则的 CSS 文件并剔除其他文件浏览器对规则的实现也是如此。
Here's my rule:
#element {
background: -moz-linear-gradient(center top, #FFF 8px, #F2F2F2 24px, #F2F2F2 100%) repeat scroll 0 0 #F2F2F2;
}
I want to take that rule and apply it to all of the browsers that support a linear gradient. What would this rule's syntax look like for Chrome, Safari, and ... Internet Explorer?
I'm considering making a super simple web app that will take a CSS file with Mozilla rules and kick out the other browser's implementations of the rules as well.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这是所要求的渐变...
Here are the gradients as requested...
这个网站就可以解决这个问题:http://www.colorzilla.com/gradient-editor/
从“CSS”区域中选择“从 css 导入”并粘贴您的代码!
例如,您可以尝试使用“
background: -moz-linear-gradient(center top, rgb(216,54,33), rgb(112,5,7));
”之类的内容。请注意:代码必须以某种方式格式化...如果逗号(“,”)后面有空格,例如这不起作用...
This site do the trick : http://www.colorzilla.com/gradient-editor/
Choose "Import from css" from the "CSS" zone and paste your code !!!
You can try with something like "
background: -moz-linear-gradient(center top, rgb(216,54,33), rgb(112,5,7));
" for exemple.Be carefull : code must be formated a certain way... if there is space after comma (", ") for exemple this do not work...
这并不太难...但是这个网站(css-tricks.com)可以解释它比我好得多。
It's not too hard... But this website (css-tricks.com) can explain it much better than I can.
您正在寻找的内容已经可以在这里找到:CSS3 渐变生成器 - 适用于 Mozilla 和基于 Webkit 的( Safari/Chrome) 浏览器。
至于 IE,MSDN 应该可以帮助你。
What you're looking for is already available here: CSS3 Gradient Generator - that works for Mozilla and Webkit-based (Safari/Chrome) browsers.
As for IE, MSDN should help you.
我通常使用类似的东西,
它可能是你将得到的跨浏览器解决方案 - 但话又说回来,CSS 不是我的强项。
I usually use something along the lines of
It's probably as crossbrowser solution as you're going to get - but then again CSS is not my forte.