Eliminate spacing between images within flex container
P粉921130067
P粉921130067 2024-03-27 12:23:19
0
1
341

[repeat]

Answer here Image inside div has extra space below image

I am displaying some images of different sizes along multiple rows. Example here

But there are gaps between the lines. I tried a lot but couldn't find the reason.

<div class="muralBox">
  <div class="wrapper">
    <div v-for="(topAlbum, i) in topAlbumInfo.value" :key="topAlbum.name" class="albums"> 
      <Album :info="topAlbum" :width="layoutConfig[i].width"/>
  </div>
  </div>
</div>

In Album.vue

<img :src="img" :width="width" :height="width" alt=""/>

and CSS:

.muralBox {
  margin: auto;
  max-width: 400px;
  min-width: 400px;
}
.wrapper {
  background: #1f1c2c;
  display: flex;
  flex-wrap: wrap;
}

P粉921130067
P粉921130067

reply all(1)
P粉451614834

I'm not sure if this is exactly what you want because I can't see how you style them, but I just gave the images 100% height and width, which is basically done in codepen .

CodePen link

.albums img{
      height: 100%;
      width: 100%;
     }
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template