有没有一种方法可以在不使用图像文件的情况下在 CSS 中创建颜色渐变?
我正在尝试为 DIV 提供具有颜色渐变的背景,使其看起来有光泽。
最佳答案
Safari(Webkit)支持它: http://webkit.org/blog/175/introducing-css-gradients/
Firefox 3.6+ 支持: https://developer.mozilla.org/en/CSS/-moz-linear-gradient
W3 规范定义了对它的支持: http://dev.w3.org/csswg/css3-images/#gradients-
并且您可以使用 Modernizr 来检测支持并回退到图像上: http://www.modernizr.com/docs/#cssgradients
关于CSS创建颜色渐变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2054940/