如何在多行flexbox布局中指定换行符?
有没有办法在多行flexbox中进行换行?
例如,在此CodePen中的每个第3项之后中断。
.container { background: tomato; display: flex; flex-flow: row wrap; align-content: space-between; justify-content: space-between;}.item { width: 100px; height: 100px; background: gold; border: 1px solid black; font-size: 30px; line-height: 100px; text-align: center; margin: 10px;}.item:nth-child(3n) { background: silver;}
<div class="container"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div> <div class="item">4</div> <div class="item">5</div> <div class="item">6</div> <div class="item">7</div> <div class="item">8</div> <div class="item">9</div> <div class="item">10</div></div>
喜欢
.item:nth-child(3n){ /* line-break: after; */ }
一只甜甜圈
精慕HU