glossary2 min read

Responsive Images

Serve different image sizes for different screen sizes with srcset.

Responsive images serve appropriately sized files to each device. A 4K desktop needs a larger image than a phone. HTML srcset attribute lists multiple sizes: <img srcset="small.jpg 400w, medium.jpg 800w, large.jpg 1200w" sizes="(max-width: 600px) 400px, 800px">. The browser picks the best fit. Combined with WebP format and lazy loading, responsive images can reduce page weight by 50-70%.