zoukankan      html  css  js  c++  java
  • css3 做出顶边倾斜的 梯形 div

     效果图:

    <html>
    <head>
    <meta charset="utf-8"> 
    <title>顶边倾斜的div梯形</title> 
    <style> 
    .box
    {
        border-radius:0px;
        width:200px;
        height:100px;
        background-color:green;
        position:relative;
    }
    .content{
        margin-top:50px;
        width:200px;
        padding-top:50px;
        overflow:hidden;
        border-radius:0px;
    }
    .box::before
    {
        position:absolute;
        top:0;
        left:0;
        content:"";
        z-index:-1;
        width:210px; /*如果需要圆角的话 不用比box的宽度长,如果不需要圆角需要增长*/
        height:100px;
        background-color:green;
        transform:rotate(-10deg);
        transform-origin:left top;
        border-radius:0px;
    }
    </style>
    </head>
    <body>
    <div class="content">
    <div class="box">Hello</div>
    </div>
    </body>
    </html>
  • 相关阅读:
    Markdown 简明语法手册
    linuxmint
    添加 Windows 8.1 无虚拟机启动项 解决极品飞车的不支持虚拟机报错
    工作室案例在线展示
    流风ASP.NET框架商业版-工作流1.0简介
    GNS3的使用2
    再见
    JSR303结合切面校验参数
    统一异常处理
    分布式会话
  • 原文地址:https://www.cnblogs.com/ITCoNan/p/11358343.html
Copyright © 2011-2022 走看看