盒子模型伪元素制作小三角

2018-08-21  本文已影响0人  张冬昱

代码

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .contain
        {
            width: 100px;
            height: 100px;
            background: salmon;
        }
        .contain::after
        {
            position: absolute;
            left: 75px;
            top: -10px;
            content: "";
            display: block;
            border: 10px solid transparent;
            border-bottom-left-radius: 25%;
            border-bottom-color:salmon; 
        }
    </style>

</head>
<body>
    <div class="contain">
[图片上传中...(伪元素制作小三角.png-862edc-1534857259128-0)]

    </div>
</body>
</html>

效果展示

伪元素制作小三角.png
上一篇下一篇

猜你喜欢

热点阅读