<div class="flex">
<!--作用了 display: contents 的元素不会影响到布局-->
<div class="displayContents">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
</div>
.flex {
display: flex;
width: 300px;
flex-wrap: nowrap;
flex-direction: row;
justify-content: space-between;
}
.displayContents {
display: contents;
}
.item {
width: 90px;
height: 30px;
background: #999;
margin: 5px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.