Picture Type doesn't appear to be picked up

I have the following code.

              <source type="image/webp" 

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

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

Do you have a codepen or jsfiddle with the code above in it? If so, we could take a look and see if there are any other issues which could be causing your issue.

I was able to create the following JSFiddle with the same thing you are attempting and it works fine.


Also, my Fiddle does not even need the type=“image/webp” to work on Chrome.

1 Like

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