美文网首页
.box > div + div { border-lef

.box > div + div { border-lef

作者: McDu | 来源:发表于2017-12-06 10:21 被阅读4次

.box > div + div { border-left: none; } 清除中间的冗余的边框, 也可以使用 .box > div:not(:first-of-type) { border-left: none; } .

/* letter-spacing clears white-space between divs.*/

body {
    letter-spacing: -8px;
}

.box * {
    letter-spacing: 0;
}

.box {
    width: 400px;
}

.box>div {
    display: inline-block;
    width: 100px;
    height: 35px;
    text-align: center;
    line-height: 35px;
    border: 1px solid #dedede;
    box-sizing: border-box;
}
<div class="box">
    <div>BLOAK</div>
    <div>FLOWER</div>
    <div>VEGETABLE</div>
    <div>DONGLE</div>
</div>
before
/* add this style */
.box>div+div {
    border-left: none;
}
after

相关文章

网友评论

      本文标题:.box > div + div { border-lef

      本文链接:https://www.haomeiwen.com/subject/wmfhixtx.html