欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2022-04-27 17:53:48
...
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