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

Why doesn't adding more entries to srcset fix a badly guessed sizes attribute?

Short interview answer

sizes tells the browser how wide the image will render at the current viewport; if that guess is wrong, the browser's width estimate is wrong regardless of how many resolution candidates exist in srcset, so it can still pick an oversized or undersized file. sizes has to match the real CSS layout, not the other way around.

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