兼容所有主流浏览器的 渐变色背景

body
{
    font-family: helvetica, arial, sans-serif;
    font-size: 13px;
    color: #666;
    background-image: -ms-linear-gradient(top, #FFFFFF 30%, #cdcdcd 100%); /* Mozilla Firefox */
    background-image: -moz-linear-gradient(top, #FFFFFF 30%, #cdcdcd 100%); /* Opera */
    background-image: -o-linear-gradient(top, #FFFFFF 30%, #cdcdcd 100%); /* Webkit (Safari/Chrome 10) */
    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.3, #FFFFFF), color-stop(1, #cdcdcd)); /* Webkit (Chrome 11+) */
    background-image: -webkit-linear-gradient(top, #FFFFFF 30%, #cdcdcd 100%); /* W3C Markup, IE10 Release Preview */
    background-image: linear-gradient(to bottom, #FFFFFF 30%, #cdcdcd 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#fffffff, endColorstr=#cdcdcdcd);/*IE<9>*/
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#ffffffff, endColorstr=#cdcdcdcd)";/*IE8+*/
}


更有详细介绍 here at http://www.luidea.com/Htmlcss/20122608.html

相关推荐