两个相邻的div边框合并

Document
网格项1
网格项2
网格项3
网格项1
网格项2
网格项3
网格项1
网格项2
网格项3
网格项1
网格项2
网格项3
网格项1
网格项2
网格项3
网格项1
网格项2
网格项3
网格项1
网格项2
网格项3

================ 代码如下

<!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>
        .grid-contaniner{
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
        }
        .grid-item{
            width:120px;
            border:solid 1px red;
            margin: -1px 0 0 -1px;
        }
    </style>
</head>
<body>
    <div class="grid-contaniner">
        <div class="grid-item">网格项1</div>
        <div class="grid-item">网格项2</div>
        <div class="grid-item">网格项3</div>
        <div class="grid-item">网格项1</div>
        <div class="grid-item">网格项2</div>
        <div class="grid-item">网格项3</div>
        <div class="grid-item">网格项1</div>
        <div class="grid-item">网格项2</div>
        <div class="grid-item">网格项3</div>
        <div class="grid-item">网格项1</div>
        <div class="grid-item">网格项2</div>
        <div class="grid-item">网格项3</div>
        <div class="grid-item">网格项1</div>
        <div class="grid-item">网格项2</div>
        <div class="grid-item">网格项3</div>
        <div class="grid-item">网格项1</div>
        <div class="grid-item">网格项2</div>
        <div class="grid-item">网格项3</div>
        <div class="grid-item">网格项1</div>
        <div class="grid-item">网格项2</div>
        <div class="grid-item">网格项3</div>
    </div>
</body>
</html>

  

posted on 2024-06-25 17:21  水行者  阅读(45)  评论(0编辑  收藏  举报

导航