Skip to content
HTML·Intermediate·Conceptual·1 min read

When should you use picture instead of a single img with srcset?

Short interview answer

Use picture when the image itself needs to change — a different crop for art direction on narrow viewports, or a different file format like AVIF or WebP with a JPEG fallback — since source conditions can select by media query or by MIME type. srcset and sizes alone only ever resolve to different resolutions of the same image.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Images, media, and responsive assets

Related questions