Skip to content
Devtoolry

Images

Images without width and height

OpportunityLow priority

Images have no width and height attributes, so the browser cannot reserve space for them. The page jumps as they load, which hurts Cumulative Layout Shift.

What it means and why it matters

When an image has width and height attributes (or a CSS aspect-ratio), the browser knows its shape before the file arrives and keeps a box of the right size. Without them, text below the image moves down when it loads.

That movement is measured as Cumulative Layout Shift, one of Google's Core Web Vitals.

How to fix it

  1. Add width and height attributes with the image's real pixel size; CSS can still make it responsive.
  2. Or set aspect-ratio in CSS for images whose size is not known in advance.
Example
<img src="boot.jpg" alt="…" width="1200" height="800" style="width:100%;height:auto">

Find it on your site

These free tools check for images without width and height and run without a sign-up:

Sources

Browse every problem in the SEO Issues Library.