I'm trying to adjust the images inside parent container to fill 100% available space, but I always end with a little space below the last image.
I would like to get rid of a red background by filling available space with the images. Photos have different sizes and aspect ratio... Any ideas?
This is what I want to achieve:
My code:
.home-photos-grid {
width: 1200px;
-webkit-column-count: 1;
-moz-column-count: 1;
column-count: 1;
-moz-column-gap: 0;
-webkit-column-gap: 0;
margin-bottom: 0;
background: #D33383;
}
.home-photos-grid .post-image {
margin: 0;
padding: 0;
display: inline-block;
width: 100%;
float: left;
}
.post-image img {
width: 100%;
}
@media only screen and (min-width: 740px) {
.home-photos-grid {
-webkit-column-count: 2;
-moz-column-count: 2;
column-count: 2;
}
}
<div class="home-photos-grid">
<div class="post-image">
<img src=" https://unsplash.it/500?image=123&gravity=east" />
</div>
<div class="post-image">
<img src="https://picsum.photos/500/400/?image=70" />
</div>
<div class="post-image">
<img src="https://picsum.photos/500/400/?image=50" />
</div>
<div class="post-image">
<img src="https://picsum.photos/500/400/?image=60" />
</div>
</div>
Thanks!