1
背景:Bootstrap 3 way of laying out 8 images in a row图片元素的WebP弯曲
我现在知道如何弯曲3个图像:
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" />
但我要介绍的小WebP的替代图片,我想你用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>
但是,我无法弄清楚如何使CSS格式的图片3跟贴像他们与IMG做。我错过了什么?
为了提供WEBP替代的目的,''支持就足够了。只有Safari 9不支持它,因此您不能将其用于JPEG2000的MIME类型切换。 –
对于本网站上的答案,您会发现有用,[考虑upvote](http://stackoverflow.com/help/someone-answers)。没有义务。只是提高质量内容的一种方式。 –