Background: Bootstrap 3 way of laying out 8 images in a row
I now know how to flex 3 images:
body {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-content: space-around;
align-items: flex-start;
}
img {
width: 30%;
order: 0;
flex: 0 1 auto;
align-self: auto;
}
<img src="https://placehold.it/1024x768" />
<img src="https://placehold.it/1024x768" />
<img src="https://placehold.it/1024x768" />
But I want to introduce smaller WebP alternative images and I think you do that with the picture element.
body {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-content: space-around;
align-items: flex-start;
}
picture {
width: 30%;
order: 0;
flex: 0 1 auto;
align-self: auto;
}
<picture>
<source srcset="http://s.natalian.org/2015-12-12/1024x768.webp" type="image/webp" />
<img src="https://placehold.it/1024x768" />
</picture>
<picture>
<source srcset="http://s.natalian.org/2015-12-12/1024x768.webp" type="image/webp" />
<img src="https://placehold.it/1024x768" />
</picture>
<picture>
<source srcset="http://s.natalian.org/2015-12-12/1024x768.webp" type="image/webp" />
<img src="https://placehold.it/1024x768" />
</picture>
However, I can't figure out how to make the CSS format the PICTUREs 3 abreast like they do with IMG. What am I missing?