但是您可以使用该<picture>
元素提供多种图像格式,以便浏览器可以选择并显示支持的图像格式:
<picture>
<source srcset="img/example.jp2" type="image/jp2"> <!-- format supported by safari -->
<source srcset="img/example.webp" type="image/webp"> <!-- format supported on many browsers -->
<source srcset="img/example.jpg" type="image/jpeg"> <!-- common supported format -->
<img src="img/example.jpg" alt="example-alt-text"> <!-- default -->
</picture>
Run Code Online (Sandbox Code Playgroud)
注意: JP2 格式的替代方案可以是 WebP 格式:
归档时间: |
|
查看次数: |
5631 次 |
最近记录: |