Prompt
What should I use for responsive image delivery on a modern website?
Latest observation
Nov 3, 2026
OpenAI APIWeb search: off
For a modern website, the best practice is usually:
Use <img> or <picture> with srcset and sizes
This gives the browser multiple image options so it can choose the best one based on:
- screen size
- device pixel ratio
- layout width
- image format support
Typical approach
<img
src="photo-800.jpg"
srcset="photo-400.jpg 400w, photo-800.jpg 800w, photo-1200.jpg 1200w"
sizes="(max-width: 600px) 100vw, 600px"
alt="Description of the image">
Use <picture> when you need:
- different formats like AVIF/WebP with JPEG fallback
- art direction, meaning different crops for different screen sizes
<picture>
<source type="image/avif" srcset="photo-800.avif 800w, photo-1200.avif 1200w">
<source type="image/webp" srcset="photo-800.webp 800w, photo-1200.webp 1200w">
<img src="photo-800.jpg" alt="Description of the image">
</picture>
Recommended delivery strategy
- Serve images in AVIF first, then WebP, then JPEG/PNG fallback
- Generate multiple widths for responsive loading
- Use lazy loading for below-the-fold images:
<img loading="lazy" ...>
Avoid relying only on CSS background images
Use them only for decorative images, because they don’t work well for:
- responsive selection
- accessibility
- lazy loading
- semantic content
Best overall stack
If you’re building a modern site, the most robust setup is:
- Responsive image markup with
srcset+sizes <picture>for format fallback or art direction- A CDN/image service that can resize and optimize on demand
- Lazy loading and proper dimensions to reduce layout shift
If you want, I can also recommend the best setup for a specific stack like React, Next.js, Astro, or plain HTML.