css伪类实现小三角

2019-06-06  本文已影响0人  放下手机出来嗨
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            .box{position: relative; width: 200px;height: 100px;border: 1px solid red;border-radius:3px;text-align:center; line-height:100px;}
            .box::after{
                content: '';
                position: absolute;
                right: -19px;
                top: 16px;
                border: 10px solid transparent;
                border-left-color:white;
            }
            .box::before{
                content: '';    
                position: absolute;
                right: -20px;
                top: 16px;
                border: 10px solid transparent;
                border-left-color: red;
            }
        </style>
    </head>
    <body>
        <div class="box">
           o(^▽^)o
        </div>
    </body>
</html>
上一篇下一篇

猜你喜欢

热点阅读