Free auditStart free
GuideSEO issue · Performance

Images without width and height

Prevent image-driven layout shifts by declaring intrinsic dimensions or an aspect ratio, then verify responsive layouts at real breakpoints.

4 min
read
3
sources
Oct 24, 2026
updated
Scaplet Editorial Team
author
In one line

When an image has no known dimensions, the browser may not reserve its final space before the file loads. Text and controls can move when that space appears, contributing to layout shift. Add accurate intrinsic width and height attributes or reserve the intended aspect ratio, keep responsive CSS, and confirm the layout stays stable while images load.

30-second check

Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
01How it works

Find images that shift nearby content

Use Chrome DevTools Performance to reproduce a load or interaction where content moves. In the Layout Shifts track, inspect the shifted nodes and the image or media component that changed the available space. Lighthouse reports images missing width and height as a CLS audit, but test the page itself because CSS, aspect-ratio rules, and component behavior affect the result. web.dev also notes that lab tools like Lighthouse may not show the full CLS of a page, since they typically measure only the initial load.
  1. 1

    Inspect the actual markup

    Check the rendered <img> element for width and height, its srcset candidates, and the CSS that controls its displayed size. Check video posters, embeds, and image wrappers separately; reserving space only for the img does not help if its container also changes height.

  2. 2

    Compare before and after load

    Throttle the network and reload. If the image begins with no space and pushes content down when it arrives, the browser did not have a usable size or ratio during initial layout.

  3. 3

    Check the source ratio

    Record the real intrinsic pixel dimensions or intended crop. Setting guessed dimensions can reserve the wrong shape and still move content when the final CSS or image ratio takes effect.

03Checklist

Fix component data and templates

  1. 01If the image CMS knows original dimensions, carry them into the generated markup instead of hard-coding estimates in every template.
  2. 02For responsive srcset, web.dev says each image should use the same aspect ratio so the <img> width and height can be set. For art-directed crops, Chrome, Firefox, and Safari support width and height on the <source> elements inside <picture>.
  3. 03For a fixed crop, define the wrapper's aspect ratio and test whether the image fills it as intended. The source file can have a different ratio when the crop is deliberate.
  4. 04If the layout shifts only when a carousel or ad loads, reserve the component's own area. Adding dimensions to the small icon inside it will not stabilize a container that changes height.
  5. 05Pair this fix with useful alternative text and appropriately sized files. Dimensions prevent uncertain layout; they do not compress an oversized image or repair missing alt text. See image SEO and image compression.
04How it works

Verify stability across content and screens

  1. 1

    Reload with a slow connection

    Confirm that the intended image area exists before the file finishes and that text and controls do not jump when it arrives.

  2. 2

    Test real viewport sizes

    Check mobile, tablet, and desktop breakpoints, including the crop and intrinsic ratio used in each layout.

  3. 3

    Check the shift trace

    Compare the Layout Shifts track before and after. If CLS remains poor, investigate fonts, injected banners, ads, or other shifting elements with the poor CLS guide.

  4. 4

    Check field data

    Monitor PageSpeed Insights or Search Console after enough visits have been collected. web.dev’s target is a CLS of 0.1 or less at the 75th percentile of page loads, and values above 0.25 are poor. A clean local test confirms the reproduced case, not every visitor's experience.

Questions

Asked a lot.

3 questions people ask next, answered from the sources on this page.

01Do responsive images still need width and height?

Yes. web.dev still recommends adding width and height even when you set max-width: 100%, so the browser can reserve space before the image loads. CSS still scales the image to its container.

02Should the HTML dimensions equal the displayed CSS size?

No. Use the intrinsic dimensions or a suitable ratio for the image source. CSS controls its rendered size; the attributes help the browser reserve the right shape.

03Do image dimensions improve CLS automatically?

They can prevent shifts caused by an image with unknown size, but other sources such as fonts, ads, embeds, and dynamically inserted content can still shift the page.

Sources · 3

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • web.dev
  1. 01Optimize Cumulative Layout Shiftweb.dev · checked 2026-10-24
  2. 02Responsive web design basicsweb.dev · checked 2026-10-24
  3. 03Web Vitalsweb.dev · checked 2026-10-24
Free · 2 minutes

Tools point. Agencies advise. This one ships.

Run the free audit, then approve the fixes. Every change can be undone.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane