箭头css

244 阅读1分钟

image.png

差不多可以了

image.png

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .arrow_box {
            width: 50px;
            height: 50px;
            /* border-radius:10px 0 0 10px; */
            background: rgba(255, 0, 0, 0.5);
            position: relative;
        }

        .arrow {
            width: 0;
            height: 0;
            border-width: 25px;
            border-style: solid;
            border-color: transparent transparent transparent rgba(255, 0, 0, 0.5);
            position: absolute;
            right: -50px;
            /* top: 35px; */
        }

        .arrow_box1 {
            width: 50px;
            height: 50px;
            /* border-radius:10px 0 0 10px; */
            background: rgba(255, 0, 0, 0.5);
            position: relative;
        }

        .arrow1 {
            width: 0;
            height: 0;
            border-width: 25px;
            border-style: solid;
            /* 上右下左 */
            border-color: rgba(255, 0, 0, 0.5) rgba(255, 0, 0, 0.5) rgba(255, 0, 0, 0.5) transparent;
            position: absolute;
            left: -50px;
            /* top: 35px; */
        }
        .father-wrap{
            display: flex;
            justify-content: space-between;
            height: 50px;
            width: 165px;
        }
    </style>
</head>

<body>
    <div class="father-wrap">
        <div class="arrow_box">
            <div class="arrow"></div>
        </div>
        <div class="arrow_box1">
            <div class="arrow1"></div>
        </div>
    </div>
</body>

</html>