DIV四边三角符号

 做个小备忘。

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        .div1{
            background: red;
            width: 100px;
            height: 100px;
            position: relative;
        }
        .div1:after{
            position: absolute;
            bottom: 0;
            width: 0;
            height: 0;
            left: 50%;
            margin-left: -10px;
            content: " ";
            border-bottom: 10px solid  #000000 ;
            border-left: 10px solid transparent ;
            border-right: 10px solid transparent ;
 
        }
        .div1:before{
            position: absolute;
            top: -10px;
            width: 0;
            height: 0;
            left: 50%;
            margin-left: -10px;
            content: " ";
            border-bottom: 10px solid  #000000 ;
            border-left: 10px solid transparent ;
            border-right: 10px solid transparent ;
 
        }
    </style>
</head>
<body>
<div class="div1">
()
</div>
</body>
</html>

~

posted on 2017-11-16 14:04  与数共舞  阅读(352)  评论(0编辑  收藏  举报

导航