I am using the picture element to create a series of background images, each should be 100vw wide and 100vh high. But there is a gap between the images, I am not sure whey. I initially had multiple source elements specified within the picture element plus the img element, but I get the same effect with only the img element, so I have used this here to keep things brief.
Dev tools shows there is no padding or margin. Can anyone explain what is creating the gap between the top and bottom of each picture elements. I want the picture elements to be adjacent, i.e. touching without a gap.
HTML
<section>
<picture>
<img class="bg_img" src="public/img/pic0.jpg">
</picture>
</section>
<section>
<picture>
<img class="bg_img" src="public/img/pic1.jpg">
</picture>
<picture>
<img class="bg_img" src="public/img/pic2.jpg">
</picture>
<img class="bg_img" src="public/img/pic3.jpg">
<picture>
<img class="bg_img" src="public/img/pic4.jpg">
</picture>
</section>
<section>
<picture>
<img class="bg_img" src="public/img/pic5.jpg">
</picture>
</section>
CSS
*{
padding:0;
margin:0;
box-sizing: border-box;
}
html, body{
width:100vw;
height:100vh;
}
.bg_img{
width:100vw;
height:100vh;
object-fit: cover;
object-position: center;
}