Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1472

How to specify line breaks in a multi-line flexbox layout?

$
0
0

Is there a way to make a line break in multiple line flexbox?

For example to break after each 3rd item in this CodePen.

.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>

Like

.item:nth-child(3n){  /* line-break: after; */    }

Viewing all articles
Browse latest Browse all 1472

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>