# 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.

Canonical: https://scaplet.com/seo-issues/images-without-dimensions

Guide SEO issue · Performance

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 with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo-issues%2Fimages-without-dimensions%20(%22Images%20without%20width%20and%20height%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo-issues%2Fimages-without-dimensions%20(%22Images%20without%20width%20and%20height%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo-issues%2Fimages-without-dimensions%20(%22Images%20without%20width%20and%20height%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo-issues%2Fimages-without-dimensions%20(%22Images%20without%20width%20and%20height%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 4 parts, 4 minutes.

1. [Find images that shift nearby content 01](#find-images-that-shift-nearby-content)
2. [Reserve the right shape 02](#reserve-the-right-shape)
3. [Fix component data and templates 03](#fix-component-data-and-templates)
4. [Verify stability across content and screens 04](#verify-stability-across-content-and-screens)

_01_How 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](/glossary/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.

_02_Choose a sizing method that matches the component

## Reserve the right shape

Image use

### Responsive editorial image with known source dimensions

Implementation

Set intrinsic `width` and `height`, then use CSS such as `max-width: 100%; height: auto`.

Watch for

Keep the attributes at the source ratio so the browser can infer the correct aspect ratio before download.

Image use

### Card or thumbnail with a deliberate crop

Implementation

Reserve the card's chosen ratio with the CSS `aspect-ratio` property, which web.dev lists as an alternative to `width` and `height`.

Watch for

Confirm the crop still shows important content at each breakpoint.

Image use

### Dynamic image or unknown source size

Implementation

Reserve an explicit container ratio based on the design or data model, then ensure the loaded image fits it.

Watch for

Do not guess a single ratio if the content can legitimately use multiple shapes.

Image use

### Video, map, or third-party embed

Implementation

web.dev says to reserve space for late-loading content, either with a `min-height` rule or, for responsive content, with CSS `aspect-ratio`. Always include `width` and `height` on video elements too.

Watch for

Test loading, error, consent, and narrow-screen states so the slot does not collapse or grow unexpectedly.

Modern browsers compute a default aspect ratio from the `width` and `height` attributes before the image loads. Once CSS gives the image a width (for example `width: 100%`), the browser uses that ratio to work out the height. web.dev shows Chrome displaying it as `aspect-ratio: auto 640 / 360`; the `auto` lets the real dimensions take over after download. If the real ratio differs, some shift still happens, but less than the 0x0 default of an image with no dimensions.

_03_Checklist

## Fix component data and templates

1. 01 If the image CMS knows original dimensions, carry them into the generated [markup](/glossary/structured-data) instead of hard-coding estimates in every template.
2. 02 For 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. 03 For 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. 04 If 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. 05 Pair this fix with useful [alternative text](/glossary/alt-text) and appropriately sized files. Dimensions prevent uncertain layout; they do not compress an oversized image or repair [missing alt text](/seo-issues/missing-alt-text). See [image SEO](/glossary/image-seo) and [image compression](/glossary/image-compression).

**Start with the largest repeated component**If many URLs share the same card or hero template, fix the component once and verify representative content ratios. That reduces repeated regressions when editors add new images.

_04_How 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](/seo-issues/poor-cls).
4. 4

### Check field data

Monitor [PageSpeed Insights](/glossary/pagespeed-insights) or [Search Console](/glossary/google-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.

_01_ Do 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.

_02_ Should 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.

_03_ Do 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. 01 [Optimize Cumulative Layout Shift](https://web.dev/articles/optimize-cls) web.dev · checked 2026-10-24
2. 02 [Responsive web design basics](https://web.dev/articles/responsive-web-design-basics) web.dev · checked 2026-10-24
3. 03 [Web Vitals](https://web.dev/articles/vitals) web.dev · checked 2026-10-24

## Keep learning

[All seo issues](/seo-issues)

[Learn Poor Cumulative Layout Shift (CLS) Performance](/seo-issues/poor-cls) [Related Core Web Vitals Performance](/glossary/core-web-vitals) [Read next Web fonts are delaying text Performance](/seo-issues/web-fonts-blocking-text) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in SEO issues
[Hreflang return links](/seo-issues/hreflang-missing-return-links) [Hreflang missing self-reference](/seo-issues/hreflang-missing-self-reference) [Infinite URL parameters](/seo-issues/infinite-url-parameters) [Intrusive interstitials](/seo-issues/intrusive-interstitial)

More in Performance
[Images without width and height](/seo-issues/images-without-dimensions) [LCP image is lazy-loaded](/seo-issues/lazy-loaded-lcp-image) [Poor Cumulative Layout Shift (CLS)](/seo-issues/poor-cls) [Poor Interaction to Next Paint (INP)](/seo-issues/poor-inp) [Poor Largest Contentful Paint (LCP)](/seo-issues/poor-lcp) [Render-blocking JavaScript](/seo-issues/render-blocking-javascript) [Slow Time to First Byte](/seo-issues/slow-ttfb) [Third-party scripts slowing your site](/seo-issues/third-party-scripts) [Web fonts are delaying text](/seo-issues/web-fonts-blocking-text)

Terms on this page
[Lighthouse](/glossary/lighthouse) [Structured data](/glossary/structured-data) [Image SEO](/glossary/image-seo) [Image compression](/glossary/image-compression) [Alt text](/glossary/alt-text) [PageSpeed Insights](/glossary/pagespeed-insights) [Google Search Console](/glossary/google-search-console)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

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

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
