1. 程式人生 > >css背景色漸變

css背景色漸變

#grad {
    height: 200px;
width:500px;
    background: -webkit-linear-gradient(left, #338fdd , #14d3e3); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(right, #338fdd, #14d3e3); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(right, #338fdd, #14d3e3); /* Firefox 3.6 - 15 */
    background: linear-gradient(to right, #338fdd , #14d3e3); /* 標準的語法(必須放在最後) */
}

<div id="grad"></div>

效果圖如下: