I am using CSS flexbox for my project. I have enabled wrapping in the flexbox. However, a space is appearing between two consecutive rows when items are getting wrapped.
HTML
<div className = {styles.top}>
<Test poster = {"https://image.tmdb.org/t/p/w600_and_h900_bestv2/6Tz1Q69o2n3Zwb0ZffzPL0nFt2T.jpg"} />
<Test poster = {"https://image.tmdb.org/t/p/w600_and_h900_bestv2/6Tz1Q69o2n3Zwb0ZffzPL0nFt2T.jpg"} />
<Test poster = {"https://image.tmdb.org/t/p/w600_and_h900_bestv2/6Tz1Q69o2n3Zwb0ZffzPL0nFt2T.jpg"} />
<Test poster = {"https://image.tmdb.org/t/p/w600_and_h900_bestv2/6Tz1Q69o2n3Zwb0ZffzPL0nFt2T.jpg"} />
<Test poster = {"https://image.tmdb.org/t/p/w600_and_h900_bestv2/6Tz1Q69o2n3Zwb0ZffzPL0nFt2T.jpg"} />
<Test poster = {"https://image.tmdb.org/t/p/w600_and_h900_bestv2/6Tz1Q69o2n3Zwb0ZffzPL0nFt2T.jpg"} />
<Test poster = {"https://image.tmdb.org/t/p/w600_and_h900_bestv2/6Tz1Q69o2n3Zwb0ZffzPL0nFt2T.jpg"} />
</div>
CSS
.top{
background-color:white;
border: 5px solid black;
width: 85%;
height: 85%;
position: relative;
top: 100px;
left: 100px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
Please note that Test is nothing but a flip card of W3 Schools (https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_flip_card). I have only changed the image and size.
The following is screenshot of my page:
Please help me to resolve this.