How to add webp support in Safari browser

The webp format is not supported by Safari as of today, and I’m not sure if it is planned for implementation in the near future. But you can give the browser a choice whether to use webp or jpg like so.

<picture>
  <source srcset="
    https://stackoverflow.com/uploads/img_small.webp 1x,
    https://stackoverflow.com/uploads/img_big.webp 2x" type="image/webp">
  <source srcset="
    https://stackoverflow.com/uploads/img_small.jpg 1x, 
    https://stackoverflow.com/uploads/img_big.jpg 2x" type="image/jpeg">
  <img src="https://stackoverflow.com/uploads/img_small.jpg">
</picture>

The browsers are smart enough to download and use only the best supported image.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)