我想使用标签和 3 种图像格式。avif\webp\png。同时,但不要忘记视网膜显示器。
目前我想出了这样的格式:
<picture>
<source srcset="components/header/img/logo.avif, components/header/img/logo@2x.avif 2x" type="image/avif">
<source srcset="components/header/img/logo.webp, components/header/img/logo@2x.webp 2x" type="image/webp">
<img class="someClass" src="components/header/img/logo.png" srcset="components/header/img/logo@2x.png 2x" alt="Logo">
</picture>
但这有多少是正确的?也许它应该以其他方式实施?