background 线性渐变

原文链接:http://caibaojian.com/css3-background-gradient.html

综上所述,线性渐变的兼容写法如下:·

//code from http://caibaojian.com/css3-background-gradient.html
.gradient{
    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 );
}
:root .gradient{filter:none;}


来源:前端开发博客

posted @ 2017-04-26 11:37  我是前端QQ942031558  阅读(302)  评论(0编辑  收藏  举报