Medium impactPerformance

Missing Image Dimensions

Images without width and height cause layout shift (CLS), hurting Core Web Vitals.

What it means

<img> tags without explicit width and height attributes (or CSS aspect-ratio), causing layout to reflow when images load.

Why it matters

Without dimensions, browsers can't reserve space, layout jumps as images load (CLS). Google penalizes high CLS scores in Core Web Vitals.

How to fix it

  1. Add width and height attributes to every <img>.
  2. Or set CSS aspect-ratio on the container.
  3. Verify CLS improvement in PageSpeed Insights.

Example

Before
<img src="hero.jpg" alt="Hero" />
After
<img src="hero.jpg" alt="Hero" width="1200" height="600" />

Find this issue on your site automatically

FreeSEO scans for missing image dimensions and 140+ other issues, free, no signup.

Frequently asked questions

Do I need both attributes and CSS?

Attributes are the safest baseline. CSS aspect-ratio is a modern alternative that works for responsive images.