答案 0 :(得分:0)
只需使用渐变CSS规则吗?
#grad {
background: linear-gradient(black, white); /* Standard syntax */
}
#grad2 {
background: red; /* For browsers that do not support gradients */
background: -webkit-linear-gradient(red, yellow, green); /* For Safari 5.1 to 6.0 */
background: -o-linear-gradient(red, yellow, green); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(red, yellow, green); /* For Firefox 3.6 to 15 */
background: linear-gradient(red, yellow, green); /* Standard syntax */
}
<div id="grad">
<br><br>
</div>
<div id="grad2">
<br><br>
</div>
一些阅读:CSS Gradients