picture element: file type

Lias and Little Puss: two ten-week-old grey tabby kittens

A WebP image will be displayed if WebP is supported, otherwise a JPEG.

Image used:

The art direction example shows how to use the picture element to enable the browser to choose an appropriate image based on viewport width. The sizes example shows how to enable image choice using the srcset and sizes attributes.

View source on GitHub