Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Images without dimensions shifting text: how to fix CLS

PRF-031Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

When a page loads, the browser lays out text first and fetches images afterwards. If the HTML does not say how big an image is, the browser treats it as zero height until the file arrives. Then it pushes everything below it down. That jump is a layout shift.

Cumulative Layout Shift (CLS) is the score Google uses to measure these jumps. A score of 0.1 or less is rated good. Images with no dimensions are one of the most common causes, and one of the easiest to fix.

Same image, with and without dimensions

No dimensions

  • Browser reserves 0 px of height
  • Headline and form sit high on the page at first
  • Image arrives and pushes them down
  • Layout shift is recorded

Width and height set

  • Browser works out the ratio from the attributes
  • Space is reserved before the file loads
  • Text and form stay where they are
  • No shift from this image

Why it costs you leads or sales

Visitors start reading or reaching for a button as soon as the page appears. If the content moves under their finger, they lose their place or tap the wrong thing. On a landing page, that can be a form field, a link or a banner instead of your call to action.

Shifts also feel untrustworthy on pages that ask for money or personal details. Layout stability is part of Google's Core Web Vitals, so a poor score can also weaken how the page is assessed in search.

How an undimensioned hero image hurts a landing page
  1. Page starts loadingText appears first
  2. Hero image arrivesNo reserved space, layout jumps
  3. Visitor taps buttonButton has moved
  4. Form or checkoutVisitor may never reach it

The image is the break point. Everything beneath it moves.

Layout shift score before and after adding dimensionsExample numbers
Layout shift score before and after adding dimensions (example)Before (no dimensions): 0.3 CLS score; After (dimensions set): 0 CLS score; Google 'good' limit: 0.1 CLS score0010.300.1Before (no dimensions)After (dimensions set)Google 'good' limitCLS score

Example: illustrative scores for a page with three undimensioned images. Your numbers will differ.

How to check if your site has it

Find images without dimensions
  1. Run PageSpeed Insights

    Test the page at pagespeed.web.dev. Look for the audit 'Image elements do not have explicit width and height' and for the 'Avoid large layout shifts' list.

  2. Use Chrome DevTools

    Open DevTools, go to the Performance panel, record a page load, and look at the Layout Shifts row in the Experience track. Click a shift to see which element moved.

  3. Throttle the network

    In the Network panel, choose Slow 4G, then reload. Slower loading makes the jump easy to see by eye.

  4. Inspect the HTML

    Right-click an image, choose Inspect, and check whether the img tag has both width and height, or a CSS aspect-ratio.

How to fix it

Give the browser the image's real pixel size. Modern browsers use the width and height attributes to compute an aspect ratio, then reserve that space even when CSS makes the image fluid.

Image with dimensions and responsive CSShtml
<img src="hero.jpg" alt="Team at work" width="1200" height="675">

<style>
img {
  max-width: 100%;
  height: auto;
}
</style>
When you cannot edit the HTML: use aspect-ratiocss
.hero-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
Fix by platform
  1. Use the Media Library

    Insert images through the block editor or Media Library. WordPress adds width and height to images it outputs by default.

  2. Check theme and page builder images

    Images set as CSS backgrounds, or hard-coded in a theme template, may lack dimensions. Edit the template and add width and height, or set an aspect ratio in the builder's image settings.

  3. Check optimisation plugins

    If a performance plugin has a setting to add missing image dimensions, enable it, then clear the cache and retest.

How to confirm it's fixed

Confirmation checklist
  • Reload with Slow 4G throttling and watch that nothing jumps
  • Rerun PageSpeed Insights and confirm the dimensions audit passes
  • Check the Layout Shifts row in DevTools shows no shift from images
  • Test on a real phone and a narrow desktop window
  • Clear caches and CDN, then test again

How to prevent it happening again

Habits that keep it fixed
  • Add images through the platform's own image tools, not pasted raw HTML
  • Add a check for width and height to your template review
  • Tell editors to upload images at the size they will be shown
  • Retest key landing pages after theme, plugin or app updates
  • Watch the CLS field data in Google Search Console's Core Web Vitals report

How FunnelGuard handles this

FunnelGuard detects this only partly. A robot visitor runs your real customer journeys on a schedule, and it checks CLS on the steps it visits. That tells you when layout shift is high on a funnel step.

It does not list which images are missing width and height, and it does not scan every page of your site for them. A raised CLS score is the signal; finding the exact image is up to you.

To cover the rest by hand, use the steps above: run PageSpeed Insights, open the Layout Shifts row in DevTools to find the element that moved, then add dimensions to that image. A free read-only website audit and a Free plan (1 site, 2 journeys, daily checks, no card) are available if you want to start monitoring.

Try it: image dimensions and layout shiftInteractive
Images have no width and height

No dimensions

Leads or data lost

Space is not reserved. The headline and button jump down when the image loads, so CLS rises and visitors may mis-tap.

Toggle the cause to see the effect on the page.

Questions people ask

Why does my page jump when images load?

The browser does not know an image's size until the file downloads, unless the HTML says so. With no width and height, it reserves no space, then pushes content down when the image appears. Adding dimensions fixes it.

Do I need width and height on every image?

Yes, ideally on every img tag, especially images near the top of the page. Set them to the file's real pixel size and keep height: auto in CSS so the image still scales on small screens.

Does adding width and height break responsive images?

No. With max-width: 100%; height: auto; in your CSS, the image scales down while the browser uses the attributes to keep the right aspect ratio and reserve space.

What is a good CLS score?

Google rates a CLS of 0.1 or less as good, 0.1 to 0.25 as needing improvement, and above 0.25 as poor. Images without dimensions can push a page into the higher bands.

How do I find which image is causing layout shift?

Record a page load in Chrome DevTools' Performance panel and open the Layout Shifts row under Experience. Clicking a shift shows the element that moved. PageSpeed Insights also lists images missing dimensions.

Can CSS aspect-ratio replace width and height?

Yes, for cases where you cannot edit the HTML. Setting aspect-ratio: 16 / 9 on the image or its container reserves the space. Attributes on the img tag are still the simplest and most widely supported fix.

Does FunnelGuard tell me which image is shifting?

No. FunnelGuard checks CLS on the funnel steps it visits, so it can flag that layout shift is high. It does not identify images missing dimensions, so you find the culprit with DevTools or PageSpeed Insights.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: CLS only.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.