Picture Type doesn't appear to be picked up

I have the following code.

 <picture>
              <source type="image/webp" 
                                 srcset="https://www.mydomain.com/images/snake.webp">

              <img class="img-fluid rounded-circle mb-3" 
                                   src="https://www.mydomain.com/images/snake.jpg" alt="Image of snake">
</picture>

Even on Chrome with .webp support the .jpg image always seems to come up. Anyone know why / what I’m doing wrong?

I thought type was only for video formats.

Supported types are listed here: http://www.iana.org/assignments/media-types/media-types.xhtml

But I don’t see webp on it.

1 Like