I am looking to load the images below one another without any gaps in between: something like this:
But currently this is what is happening:
As seen, a space is getting added between images if the images are of not the same size. I think since I'm using Flexbox this is causing this issue. below is my code:
Js:
const list = [{title: "abd",id: 123}, {title: "gferger",id: 7676}, {title: "htytyjtyujt",id: 65575}];
{list.map((obj) => {
<div class="image-container">
<img class="img-section"/>
<div class="image-title">{obj.title}</div>
</div>
});
css:
.img-section {
width: 200px;
height: 300px;
}
.image-container {
display: flex;
flex-wrap: wrap;
justify-content: space-evenly;
}
however I'm not sure if there is any other way to display all images next to each other and also ensure no white spaces are seen when there is an uneven image size. Any ideas ???