是的,它是可能的,但每一个浏览器似乎使用不同的方法:
HTML
<div id="element">Your content here.</div>
CSS
#element {
background: #000000;
background: -moz-linear-gradient(top, #000000 0%, #ffffff 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#000000), color-stop(100%,#ffffff));
background: -webkit-linear-gradient(top, #000000 0%, #ffffff 100%);
background: -o-linear-gradient(top, #000000 0%, #ffffff 100%);
background: -ms-linear-gradient(top, #000000 0%, #ffffff 100%);
background: linear-gradient(to bottom, #000000 0%, #ffffff 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#ffffff',GradientType=0); }
你可以改变颜色的CSS上面还有每种颜色混合的百分比。
是的,它是..为背景..,通过谷歌搜索“css渐变”:http://www.w3schools.com/css/css3_gradients.asp – Hardy
@ Hardy请使用答案!低于 – juniorRubyist
是的,这是一个[梯度发生器](http://www.colorzilla.com/gradient-editor/)。 – mdesdev