zoukankan      html  css  js  c++  java
  • css渐变实现

    body{
             100%;
            height: 100%;
            overflow: hidden;
        }
        *{
            margin: 0px;
            padding: 0px;
            font-size: 0px;
        }
        .example{
             100%;
            height: 100%;
            background: -moz-linear-gradient( top,#ccc,#000);
            background: -webkit-linear-gradient( top,#ccc,#cddc39);
            background: -o-linear-gradient(top,#ccc, #000);
        }
        #grad{
             150%;
            height: 150%;
            position: absolute;
            top: 0px;
            left: 0px;;
            background: -webkit-radial-gradient(rgba(255, 0, 0, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Safari 5.1 - 6.0 */
            background: -o-radial-gradient(rgba(255, 0, 0, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Opera 11.6 - 12.0 */
            background: -moz-radial-gradient(rgba(255, 0, 0, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Firefox 3.6 - 15 */
            background: radial-gradient(rgba(255, 0, 0, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* 标准的语法 */
         }
         #grad2{
             170%;
            height: 150%;
            position: absolute;
            top: -50%;
            left: 20%;
            background: -webkit-radial-gradient(rgba(233, 30, 99, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Safari 5.1 - 6.0 */
            background: -o-radial-gradient(rgba(233, 30, 99, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Opera 11.6 - 12.0 */
            background: -moz-radial-gradient(rgba(233, 30, 99, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Firefox 3.6 - 15 */
            background: radial-gradient(rgba(233, 30, 99, 0.2) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* 标准的语法 */
         }
    
         #grad3{
             170%;
            height: 170%;
            position: absolute;
            top: -50%;
            left: -70%;
            background: -webkit-radial-gradient(rgba(33, 150, 243, 0.4) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Safari 5.1 - 6.0 */
            background: -o-radial-gradient(rgba(33, 150, 243, 0.4) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Opera 11.6 - 12.0 */
            background: -moz-radial-gradient(rgba(33, 150, 243, 0.4) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* Firefox 3.6 - 15 */
            background: radial-gradient(rgba(33, 150, 243, 0.4) 2%, rgba(255, 0, 0, 0) 60%,rgba(255, 0, 0, 0) 80%); /* 标准的语法 */
         }
    

      

     线性渐变 (top)

    .example {
             150px;
            height: 80px;
            background: -moz-linear-gradient( top,#ccc,#000); /*Mozilla*/
            background: -webkit-linear-gradient(top,#ccc,#000); /*new gradient for Webkit*/
            background: -o-linear-gradient(top,#ccc, #000); /*Opera11*/
            filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#1471da, endColorstr=#1C85FB);/*IE<9>*/
            -ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#1471da, endColorstr=#1C85FB)";/*IE8+*/
        }  
    

    线性渐变 (left)

    .example {
             150px;
            height: 80px;
            background: -moz-linear-gradient( left,#ccc,#000); /*Mozilla*/
            background: -webkit-linear-gradient(left,#ccc,#000); /*new gradient for Webkit*/
            background: -o-linear-gradient(left,#ccc, #000); /*Opera11*/
            filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr=#1471da, endColorstr=#1C85FB);/*IE<9>*/
            -ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=1, startColorstr=#1471da, endColorstr=#1C85FB)";/*IE8+*/
        }  

    线性渐变(100deg)

    .example {
             150px;
            height: 80px;
            background: -moz-linear-gradient( 100deg,#ccc,#000); /*Mozilla*/
            background: -webkit-linear-gradient(100deg,#ccc,#000); /*new gradient for Webkit*/
            background: -o-linear-gradient(100deg,#ccc, #000); /*Opera11*/
            filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr=#1471da, endColorstr=#1C85FB);/*IE<9>*/
            -ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=1, startColorstr=#1471da, endColorstr=#1C85FB)";/*IE8+*/
        } 
    

      

    线性渐变(left top)

     .example {
             150px;
            height: 80px;
            background: -moz-linear-gradient( left top,#ccc,#000); /*Mozilla*/
            background: -webkit-linear-gradient(left top,#ccc,#000); /*new gradient for Webkit*/
            background: -o-linear-gradient(left top,#ccc, #000); /*Opera11*/
            filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr=#1471da, endColorstr=#1C85FB);/*IE<9>*/
            -ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=1, startColorstr=#1471da, endColorstr=#1C85FB)";/*IE8+*/
        }  
  • 相关阅读:
    IIS发布问题解决
    创建Core项目使用IdentityServer4
    通过数据库名称字符串 反射获取数据并刷新对应缓存
    MVC模式下unity配置,报错“No connection string named '**Context' could be found in the application config file”
    Docker巨轮的航行之路-基础知识篇
    C#之LINQ
    Js调试中不得不知的Console
    jQuery中是事件绑定方式--on、bind、live、delegate
    前端常用技术概述--Less、typescript与webpack
    ES6学习之变量的解构赋值
  • 原文地址:https://www.cnblogs.com/chenyi4/p/11417205.html
Copyright © 2011-2022 走看看