.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
网友评论