# Image missing width or height

> An <img> has no width or height attribute. The browser cannot reserve space before the image loads, so the page shifts and Cumulative Layout Shift goes up.

Source: https://seocode.io/checks/image-missing-dimensions

[All checks](https://seocode.io/checks) / Images

An `<img>` has no width or height attribute.

Info `image-missing-dimensions`

In SEOCode's checks since 22 Oct 2026

- [Add to GitHub](https://github.com/apps/seocode-pr-check/installations/new)

- [Read the docs](https://seocode.io/docs)

## Why this matters.

An `<img>` has no width or height attribute. The browser cannot reserve space before the image loads, so the page shifts and Cumulative Layout Shift goes up.

Runs on `.html` `.jsx` `.tsx` `.vue` `.svelte` · Advisory checks point at an improvement. They never block a merge.

## How to resolve it.

Add width and height matching the image's real size, for example `<img src="photo.jpg" width="800" height="600" alt="...">`, and let CSS scale it.

**SEOCode writes this fix for you**

On a pull request the fix arrives as a suggestion you can commit in one click, when the change is unambiguous on the line.

## Where this comes from.

- [01 · Optimize Clsweb.dev](https://web.dev/articles/optimize-cls#images-without-dimensions)

Using a framework? [Next.js](https://seocode.io/nextjs-seo) · [SvelteKit](https://seocode.io/sveltekit-seo) · [Nuxt](https://seocode.io/nuxt-seo)

## Related checks.

Alt text, lazy loading and the image signals that decide whether a picture is indexed.

- [01 · Image missing alt attribute Critical Images without alt attributes are invisible to search engines and fail accessibility standards (WCAG 2.1).](https://seocode.io/checks/image-missing-alt)

- [02 · Image has empty alt (possible oversight) Info Image has alt="" which is valid only for purely decorative images.](https://seocode.io/checks/image-empty-alt)

- [03 · Image missing lazy loading Info Images without loading="lazy" are loaded immediately, increasing initial page load time and hurting Core Web Vitals.](https://seocode.io/checks/image-missing-lazy-loading)

- [04 · Inconsistent image URL references Info Image URLs should be referenced consistently across pages for easier crawling on larger websites.](https://seocode.io/checks/image-url-consistency)

- [05 · Missing image metadata for Search/Discover thumbnails Info Google uses both schema.org markup and the og:image tag as sources when determining image thumbnails in Google Search and Discover.](https://seocode.io/checks/image-preferred-source-metadata)

- [06 · Video thumbnail has excessive transparency Warning Google requires that at least 80% of video thumbnail pixels have little or no transparency to enable video indexing.](https://seocode.io/checks/video-transparency)

[All 9 images checks](https://seocode.io/checks#images)

## Every check, on every pull request.

SEOCode runs the full ruleset on each change and comments the fixes inline.

- [Add to GitHub](https://github.com/apps/seocode-pr-check/installations/new)

- [Get a website audit](https://seocode.io/audit?from=checks-cta)

Free for public repositories · no credit card
