Picture element doesn't fallback to JPG on Safari but display empty Webp

Viewed 88

I'm using a responsive image element with differents formats and conditions. it works perfectly on Chrome, but it keeps displaying empty Webp on Safari.

I'm testing on macOS Big Sur, safari 14.

Here is my code :

<picture>
  <source
    srcset="image.webp, image@2x.webp 2x"
    type="image/webp"
    media="(min-width: 768px)"
  />
  <source
    srcset="image.webp"
    type="image/webp"
    media="(max-width: 768px)"
  />
  <source
    srcset="image.jpg, image@2x.jpg 2x"
    type="image/jpeg"
    media="(min-width: 768px)"
  />
  <source
    srcset="image.jpg"
    type="image/jpeg"
    media="(max-width: 768px)"
  />
  <img
    src="image.jpg"
    alt=""
  />
</picture>

Thanks for your help !

0 Answers
Related