Prompt
I'm building a content site and need responsive images by breakpoint
Latest observation
Nov 3, 2026
OpenAI APIWeb search: off
To implement responsive images by breakpoint on a content site, the usual approach is:
1) Use srcset + sizes
This lets the browser choose the best image based on viewport width and device pixel ratio.
<img
src="image-800.jpg"
srcset="
image-480.jpg 480w,
image-800.jpg 800w,
image-1200.jpg 1200w,
image-1600.jpg 1600w
"
sizes="
(max-width: 600px) 100vw,
(max-width: 1024px) 50vw,
33vw
"
alt="Descriptive alt text"
/>
How it works
srcset: lists available image widths.sizes: tells the browser how wide the image will be rendered at different breakpoints.- The browser picks the most appropriate file automatically.
2) Use <picture> when you need different crops per breakpoint
If mobile and desktop need different aspect ratios or crops, use <picture>:
<picture>
<source media="(max-width: 600px)" srcset="hero-mobile.jpg">
<source media="(max-width: 1024px)" srcset="hero-tablet.jpg">
<img src="hero-desktop.jpg" alt="Hero image">
</picture>
Use this when:
- mobile needs a portrait crop
- desktop needs a wide crop
- you want art direction, not just resizing
3) Recommended breakpoint strategy
A simple set:
- mobile: up to 600px
- tablet: 601px–1024px
- desktop: 1025px+
Example:
<picture>
<source media="(max-width: 600px)" srcset="image-mobile.jpg">
<source media="(max-width: 1024px)" srcset="image-tablet.jpg">
<img src="image-desktop.jpg" alt="Content image">
</picture>
4) Best practices
- Always include
alt - Serve modern formats where possible:
- AVIF
- WebP
- fallback JPG/PNG
- Keep image dimensions accurate to avoid layout shift
- Use
loading="lazy"for below-the-fold images:<img loading="lazy" ...>
5) If you’re using a CMS or framework
You may want to generate multiple sizes automatically:
- WordPress: built-in responsive image support
- Next.js:
next/image - Gatsby: image plugins
- Drupal/Contentful/Sanity: transformations/CDN resizing
If you want, I can give you:
- a copy-paste HTML solution for your exact breakpoints,
- a WordPress/CMS setup, or
- a React/Next.js implementation.