这种样式怎么实现?

新手上路,请多包涵

image.png
想问下这种样式怎么实现

阅读 2.6k
2 个回答

你说的是那个线吗?想象一下,一个矩形,加上边框,然后去除右边框,不就出来了?

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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .box {
        height: 21px;
        padding: 4px;
        background: #ccc;
        color: #000;
        width: fit-content;
    }

    .hui {
        color: gray;
    }

    .lan {
        background: rgb(161, 161, 201);
        color: blue;
    }

    .flex {
        display: flex;
        align-items: center;
    }

    .m-l-10 {
        margin-left: 10px;
    }
    .ju {
    width: 50px;
    height: 50px;
    border: 2px solid #ccc;
    margin-left: 10px;
    border-right-color: transparent;
}
</style>

<body>
    <div>
        <div class="flex">
            <div class="box hui">且1</div>
            <div class="box lan m-l-10">或</div>
            <div class="ju"></div>
            <div class="box  m-l-10">或1111</div>

        </div>


    </div>

</body>

</html>

image.png

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题