Let\'s say I have a div which will contain a set of elements (divs), which may have different heights, but all of them will have the same width.
I\'ve a
Here's a link on solution! Used only flex.
html
- var n = 0;
ul
while n < 40
li= n++
li
css
ul {
list-style: none;
padding: 30px;
background: #28285e;
li {
padding: 20px;
margin: 6px;
background: white;
width: calc(50% - 52px);
height: 100px;
display: inline-block;
border: {
radius: 4px
}
&:nth-child(3n) {
height: 40px;
}
&:nth-child(2n + 1) {
height: 80px;
}
&:nth-child(even) {
float: right;
}
&:nth-child(odd) {
float: left;
}
&:last-child {
clear: both;
float: none;
}
}
}