There is a gap between content 2 and content 4 because .div2 doesn't have a height set, and divs side-by-side are not automatically aligned.
There are two options: either you put a height on .div2, or you use flexbox. In my opinion, flexbox is the cleanest way to do this.
How to do that here: you wrap div1 and div2 in a parent div, and you give it the class
row
:
<div class="row"><div class="div1">
some content1
</div><div class="div2">
some content2
</div></div><div class="div3">
some content3
</div><div class="div4">
some content4
</div>
And in your CSS, you add this:
.row {
display: flex;
}
That's all you need here!
You can do a lot more with flexboxes. If you're interested, take a look at
Using CSS Flexible Boxes - CSS | MDN[
^]