Affichage des images sur Safari 15
Les images ne s'affichent pas sur Safari <16, car seul le format WepP est proposé: https://caniuse.com/?search=webp
Il faudrait utiliser les balises <picture>
et <source>
pour proposer un fallback en JPG, et ajouter au passage l'attribut height
sur les <img>
.
Code actuel:
<figure>
<img src="/path/to/image.webp" width="375" loading="lazy" alt="">
</figure>
Code souhaité:
<figure>
<picture>
<source srcset="/path/to/image.webp" type="image/webp">
<img src="/path/to/image.jpg" width="375" height="300" loading="lazy" alt="">
</picture>
</figure>