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粉4516148342024-03-28 11:15:51
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 .
.albums img{ height: 100%; width: 100%; }