The inner divs will be thumbs that are being continuously added and eventually wrap to next row.
The space between divs should be 20px. I want four divs in one row.
Two constraints:
- Ideally no flexbox space-between, due to last row looking weird with only two divs.
- Adding margin only between inner divs not a good option (unless there’s an easy way to do this for dynamically added content?).
Is there a way to accomplish this?
#outer {
width: 460px;
display: inline-block;
}
.inner {
width: 100px;
height: 100px;
float: left;
}
<div id="outer">
<div class="inner">1</div>
<div class="inner">2</div>
<div class="inner">3</div>
<div class="inner">4</div>
</div>