Responsive Images for Business Websites: srcset, sizes and Verifying the Download
A responsive image is not merely a file styled to 100% width. If the browser receives one large asset, it can scale the display but has already downloaded all of its bytes. The HTML srcset and sizes attributes let authors provide candidates and describe the expected image slot, while the browser selects an appropriate resource.
The HTML Living Standard defines the syntax and selection model, and MDN documents practical patterns. Selection deliberately belongs to the browser and depends on the candidates, source size and environment. Implementation therefore cannot be verified by reading markup alone: inspect currentSrc and the actual network request at representative viewports.
1. Measure the image slot, not only the screen
Inventory each role: full-width hero, card, article column or gallery. At important breakpoints, measure the CSS width of the slot. An image in a 720 CSS-pixel column needs a different description from one that spans the viewport.
Separate resolution switching from art direction. When the content and crop stay the same, width candidates in srcset are appropriate. When mobile requires a different crop or composition, use picture and source, preserving meaningful alternative text on img.
Hero
Same crop: Width candidates
Different crop: picture / source
Check: Important content remains visible
Article image
Same crop: srcset + sizes
Different crop: Rarely needed
Check: Width follows column
Card
Same crop: Narrow candidates
Different crop: Dedicated crop if needed
Check: No oversized transfer
Logo or icon
Same crop: Often SVG
Different crop: Not applicable
Check: Sharpness and accessibility
2. Create genuine width candidates
Export a reasonable set of widths from one high-quality source, based on actual slots and display densities. In srcset, label each file with its intrinsic width using a w descriptor. The descriptor must match the resource; an inaccurate value corrupts the selection input.
Do not create many nearly identical variants without measurement. Each asset adds production, storage and invalidation cost. Begin with meaningful mobile, tablet and wide-column steps, then use Network evidence to identify gaps.

3. Write sizes to match the CSS layout
When srcset uses w descriptors, sizes describes the expected source size. Order matters: the browser uses the first matching condition, with the final value acting as the default when earlier conditions do not match.
The description must reflect CSS. If an image is nearly viewport-wide on small screens but constrained to a column on desktop, encode that relationship. A blanket 100vw for an image occupying half a desktop container may encourage a larger candidate than needed.
4. Preserve dimensions, format and layout stability
Set width and height with the source aspect ratio, then adapt display size in CSS. This helps reserve space before loading. Do not use arbitrary values that distort the ratio, and do not expect loading to correct a poor candidate choice.
Modern formats may reduce transfer size, but confirm quality and browser support. picture can offer formats through type with a suitable fallback img. Keep the same meaningful alt text regardless of the selected file.
5. Inspect currentSrc and the network request
Read document.querySelector(...).currentSrc after loading. This read-only value reports the selected candidate URL, but it does not prove successful loading. In Network, also inspect status, transferred bytes, response dimensions and cache involvement.
Test at 390, 768 and 1440 CSS pixels with representative device-pixel ratios. Disable cache for a controlled run or record when it is used. Resizing an existing window may be misleading because a browser can keep a previously downloaded higher-quality resource.
6. Build verification into maintenance
Keep a matrix of viewport, expected slot, selected URL, intrinsic width and transferred bytes. Express expectations as ranges rather than claiming every browser must select the same file; the standard allows user-agent discretion based on environmental conditions.
Repeat checks after a layout change because an unchanged sizes value can become wrong. Automate existence checks for candidates and retain manual Network review for important pages. Do not promise a precise saving without measuring the actual files and traffic.
- Measure real image slots.
- Export candidates with accurate intrinsic widths.
- Align sizes with CSS breakpoints.
- Preserve aspect ratio and alt text.
- Inspect currentSrc and the network request.
- Retest after layout changes.
7. Frequently asked questions
Is width: 100% enough?
No. CSS controls display width, but without multiple sources the browser may still download one large file.
Does the browser always choose the smallest sufficient image?
Not necessarily. Selection depends on candidates, source size, density and other user-agent conditions.
What does currentSrc show?
The URL currently selected by the browser; it does not guarantee successful loading.
When should I use picture?
For art direction or format changes, not merely another resolution of identical content.
Should width and height be present?
Yes when known, with the correct aspect ratio to support layout stability.
How many candidates are optimal?
There is no universal count. Base it on actual slots, densities and network measurements.
8. Conclusion
A sound responsive-image workflow starts with the real slot width, continues with accurate candidates and sizes, and ends by checking currentSrc and the network request. Markup, CSS and generated assets must remain aligned after every layout change.
Sources: WHATWG HTML Living Standard: responsive images, MDN: Using responsive images in HTML, MDN: HTMLImageElement.currentSrc. Accessed 24 November 2026.
Send the page layout and current image assets for a responsive-image implementation review.