zoukankan      html  css  js  c++  java
  • css3边角旋转

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }
        
        .box {
            width: 500px;
            height: 500px;
            background: #ddd;
            margin: 20px auto;
            position: relative;
        }
        
        .box .icon {
            display: block;
            height: 30px;
            line-height: 30px;
            color: #fff;
            position: absolute;
            right: -35px;
            top: 35px;
            transform: rotate(45deg);
            -ms-transform: rotate(45deg);
            -moz-transform: rotate(45deg);
            -webkit-transform: rotate(45deg);
            -o-transform: rotate(45deg);
        }
        
        .box .icon span {
            display: inline-block;
            float: left;
        }
        
        .box .icon span.left {
            width: 0;
            height: 0;
            border-top: 30px solid transparent;
            border-right: 30px solid #db0202;
        }
        
        .box .icon span.right {
            width: 0;
            height: 0;
            border-top: 30px solid transparent;
            border-left: 30px solid #db0202;
        }
        
        .box .icon span.center {
            height: 30px;
            line-height: 30px;
            color: #fff;
            background-color: #db0202;
        }
        </style>
    </head>
    
    <body>
        <div class="box">
            <div class="icon"><span class="left"></span><span class="center">专营高品质茶器</span><span class="right"></span></div>
        </div>
    </body>
    
    </html>

    效果图:

  • 相关阅读:
    mybatis
    Hello mybatis
    linux各种终端类型的区别和概念
    页面对象的定位
    laravel 操作 redis
    Python应用与实践
    Mysql与Oracle区别
    PHP 中 call_user_func 函数 和 call_user_func_array 函数的区别
    php依赖注入
    Linux/Unix 怎样找出并删除某一时间点的文件
  • 原文地址:https://www.cnblogs.com/huanghuali/p/6775278.html
Copyright © 2011-2022 走看看