Skip to content

All checks / Images

Image missing width or height

An <img> has no width or height attribute.

Info image-missing-dimensions

In SEOCode's checks since 22 Oct 2026


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 Cls

web.dev

Using a framework? Next.js · SvelteKit · Nuxt



Every check, on every pull request.

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

Free for public repositories · no credit card