zoukankan      html  css  js  c++  java
  • 纯css3棋盘图案背景以及45度斜纹背景

    css代码 

    .stripes {

        height: 250px;
        375px;
        float: left;
        
        margin: 10px;
        
        -webkit-background-size: 50px 50px;
        -moz-background-size: 50px 50px;
        background-size: 50px 50px; /* 控制条纹的大小 */
        
        -moz-box-shadow: 1px 1px 8px gray;
        -webkit-box-shadow: 1px 1px 8px gray;
        box-shadow: 1px 1px 8px gray;
    }
    .checkered {
        background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, #555), color-stop(.25, transparent), to(transparent)),
                          -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, #555), color-stop(.25, transparent), to(transparent)),
                          -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.75, transparent), color-stop(.75, #555)),
                          -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.75, transparent), color-stop(.75, #555));
        background-image: -moz-linear-gradient(45deg, #555 25%, transparent 25%, transparent),
                          -moz-linear-gradient(-45deg, #555 25%, transparent 25%, transparent),
                          -moz-linear-gradient(45deg, transparent 75%, #555 75%),
                          -moz-linear-gradient(-45deg, transparent 75%, #555 75%);
        background-image: -o-linear-gradient(45deg, #555 25%, transparent 25%, transparent),
                          -o-linear-gradient(-45deg, #555 25%, transparent 25%, transparent),
                          -o-linear-gradient(45deg, transparent 75%, #555 75%),
                          -o-linear-gradient(-45deg, transparent 75%, #555 75%);
        background-image: linear-gradient(45deg, #555 25%, transparent 25%, transparent),
                          linear-gradient(-45deg, #555 25%, transparent 25%, transparent),
                          linear-gradient(45deg, transparent 75%, #555 75%),
                          linear-gradient(-45deg, transparent 75%, #555 75%);
    }


    .angled {
        background-color: #ac0;
        background-image: -webkit-gradient(linear, 0 100%, 100% 0,
                                color-stop(.25, rgba(255, 255, 255, .2)), color-stop(.25, transparent),
                                color-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .2)),
                                color-stop(.75, rgba(255, 255, 255, .2)), color-stop(.75, transparent),
                                to(transparent));
        background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%,
                            transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%,
                            transparent 75%, transparent);
        background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%,
                            transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%,
                            transparent 75%, transparent);
        background-image: linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%,
                            transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%,
                            transparent 75%, transparent);
    }

    html代码 

     <div class="checkered stripes"></div>

    <div class="angled stripes"></div> 

  • 相关阅读:
    在IDEA上本地更新同步Git中的更改
    protobuf的序列化和反序列化
    关于Pytorch报警告:Warning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead
    990. 等式方程的可满足性
    死锁
    事务隔离
    Lab-1
    软件测试homework3
    TCP/UDP网络连接的固定写法
    软件测试Homework 2
  • 原文地址:https://www.cnblogs.com/NatChen/p/8176093.html
Copyright © 2011-2022 走看看