All jobs / Frontend / web developer / Performance

Frontend / web developer interview question · 0–1 years

Images pop the page down as they load. What do you set and why?

The strongest answer

Set width and height (or aspect-ratio) so the browser reserves space; keep max-width: 100% so they still shrink

Why it works

Reserved aspect ratio is the CLS fix. HTML width/height plus CSS is the usual pattern.

What a good answer covers

Answers that fall short

Who gets asked this

More Performance questions