I am trying to create a container with 2 columns with a bunch of images of different sizes (I want them to stay different sizes) that align like this:
I have tried using flexbox like this:
.container {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.item {
flex-basis: 50%;
}
but the result of this is the following which every 2 columns get aligned to the top, but I want the images to float to each other as shown in the previous screenshot.
I have tried using floats but the following weird behavior happens:
.container {
display: block;
}
.item {
width: 50%;
display: inline-block;
float: left;
}
Does anyone know how to correctly align images to each other as the first image shows?