css3写平行四边形

<html>

    <head>
        <meta charset="UTF-8">
        <title>平行四边形</title>
        <style type="text/css">
           
            .skew {
                width: 100px;
                height: 73px;
                background: #f0eb4f;
                margin: 0 auto;
                text-align: center;
                transform: skew(15deg);
                box-shadow: 2px 3px 5px #a7a0a0;
            }
            
            .skew-main {
                transform: skew(-15deg);
            }
        </style>
    </head>

    <body>
        <div class="skew">
            <div class="skew-main">平行四边形</div>
        </div>
    </body>

</html>

结果如图所示:

 

posted @ 2019-10-10 09:18  氧化成风  阅读(850)  评论(0编辑  收藏  举报