Check out this example I found: https://jsfiddle.net/n3qs0wke/
.wrapper {
max-width: 600px;
border: 1px solid #333;
}
.big-div {
min-width: 212px;
min-height: 212px;
max-width: 212px;
max-height: 212px;
display: inline-flex;
background-color: #778;
margin: 4px;
}
.small-div {
min-width: 100px;
min-height: 100px;
max-width: 100px;
max-height: 100px;
display: inline-flex;
background-color: #787;
margin: 4px;
}
<div class="wrapper">
<div class="big-div"></div>
<div class="small-div"></div>
<div class="small-div"></div>
<div class="small-div"></div>
<div class="small-div"></div>
<div class="small-div"></div>
<div class="small-div"></div>
</div>
I'm trying to figure out how to make the .small-div
elements fill 2 rows next to the .big-div
, and only move under the .big-div
once two rows are full. It's sort of like giving rowspan="2"
to .big-div
I have a feeling this question might have been answered on SO, but CSS terminology is not my strong suit so I wasn't sure what exactly to search for.
Thank you in advance!