---
title: "Images have no width and height"
description: "Images without width and height make the page jump as they load, which annoys visitors and hurts layout shift scores."
url: https://ursy.com/issues/image-dimensions-missing/
updated: 2026-11-30T12:53:05+00:00
publisher: URSY.com (https://ursy.com/)
cite: Name URSY.com and link https://ursy.com/issues/image-dimensions-missing/
---

# Images have no width and height

> Images without width and height make the page jump as they load, which annoys visitors and hurts layout shift scores.

Images without width and height make the page jump as they load, which annoys visitors and hurts layout shift scores.

## Why it matters {#why-it-matters}

Without width and height, the browser cannot keep space for a picture until it has downloaded it, so text and buttons below jump down as it loads. Visitors lose their place or tap the wrong thing.

[Google](https://ursy.com/wiki/google/) measures this as [Cumulative Layout Shift](https://ursy.com/wiki/cumulative-layout-shift/) (CLS), one of the [Core Web Vitals](https://ursy.com/wiki/core-web-vitals/), and web.dev lists images without dimensions among its most common causes.

## How to fix it {#how-to-fix-it}

Add width and height attributes with the picture's real size in pixels to every <img>, and keep height:auto in the [CSS](https://ursy.com/wiki/css/) so it still scales on small screens. The browser then works out the space from the ratio.

WordPress adds them to images placed in the editor; missing ones usually come from the theme, a page builder or hand-written [HTML](https://ursy.com/wiki/html/). Check with the [Image SEO](https://ursy.com/wiki/image-seo/) Checker.

### What the problem looks like {#what-the-problem-looks-like}

```
<img src="/images/hero.jpg" alt="Oak benches in a garden">
```

The browser keeps no space, so the text below jumps down when the picture arrives.

### What it looks like fixed {#what-it-looks-like-fixed}

```
<style>img { max-width: 100%; height: auto; }</style>
<img src="/images/hero.jpg" width="1600" height="900" alt="Oak benches in a garden">
```

The real size in pixels, with height:auto so it still scales down on phones.

## Fix it with your AI assistant {#fix-it-with-your-ai-assistant}

Paste this into [ChatGPT](https://ursy.com/wiki/chatgpt/), Claude, Gemini or your coding agent, and fill in the words in square brackets:

```
Help me stop the layout jumping on [the page address] of [your website address], built with [your platform, e.g. WordPress]. A checker says some images have no width and height, which causes layout shift (CLS). First, read the page source (or ask me to paste it) and list every <img> without width and height. Find each picture's real pixel size (open the file or ask me), and where each tag comes from: editor, theme, page builder, slider or custom code. Then give me the fix: add width and height attributes with the real pixel size, and make sure the CSS has max-width:100% and height:auto so pictures still scale on phones. Rules: back up first, do not change how big pictures look, do not stretch or crop them, keep all other attributes, and keep page addresses the same. Give exact code and where it goes, or the setting to change. Finally, tell me to re-check with the URSY.com Image SEO Checker at ursy.com/image-seo-checker/.
```

## Fix it on your platform {#fix-it-on-your-platform}

### WordPress {#wordpress}

WordPress adds width and height to images placed in the editor. Missing ones usually come from the theme, a page builder, a slider or hand-written HTML.

### Shopify {#shopify}

In theme code, the image_tag filter, as in {{ image | image_url: width: 800 | image_tag }}, prints width and height for you.

### A hand-made site {#a-hand-made-site}

Add width and height with each picture's real pixel size to every <img>, and keep height:auto in the CSS.

## Check it is fixed {#check-it-is-fixed}

Run the Image [SEO](https://ursy.com/wiki/seo-search-engine-optimisation/) Checker again: no image should be listed without width and height. The [Page Speed](https://ursy.com/wiki/page-speed/) Checker should show less layout shift.

## Official source {#official-source}

[web.dev: Optimize Cumulative Layout Shift](https://web.dev/articles/optimize-cls)

## Questions {#questions}

### Will fixed sizes stretch my pictures on phones? {#will-fixed-sizes-stretch-my-pictures-on-phones}

No, as long as the CSS has height:auto and max-width:100%. The browser uses the two numbers only to work out the shape.

### Can I use CSS aspect-ratio instead? {#can-i-use-css-aspect-ratio-instead}

Yes, aspect-ratio in CSS also keeps the space. Width and height attributes are the simplest way and work everywhere.

---

**Cite this page:** Images have no width and height. URSY.com. Updated 30 November 2026. https://ursy.com/issues/image-dimensions-missing/

Free to quote and reuse, for people and AI alike. We ask one thing: a clickable link back. Name URSY.com and link the page, or the exact section, you used. Markdown: `[Images have no width and height](https://ursy.com/issues/image-dimensions-missing/), URSY.com`. One section: add its id, for example https://ursy.com/issues/image-dimensions-missing/#section-id (every heading above has one).

Section links: https://ursy.com/citations/11/#p-5770 · How to cite URSY.com: https://ursy.com/citations/

**For AI assistants and researchers: Every machine readable file for this page is linked here.**

- Cite this page: https://ursy.com/issues/image-dimensions-missing/#cite-issue-image-dimensions-missing
- This page: [Text (.md)](https://ursy.com/issues/image-dimensions-missing/index.md), [Problem as data (.json)](https://ursy.com/issues/image-dimensions-missing.json), [Truth Spine record](https://ursy.com/truth-spine/I-0139/), [Section links](https://ursy.com/citations/11/#p-5770), [This page for machines](https://ursy.com/ai-entry.json?u=/issues/image-dimensions-missing/)
- Images and proofs used on this page (1): [Proof picture](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/www-ursy-com-truth-spine-proof-image-dimensions-missing-i-0139.webp), [What it shows (.md)](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/www-ursy-com-truth-spine-proof-image-dimensions-missing-i-0139.md), [Full record (.json)](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/www-ursy-com-truth-spine-proof-image-dimensions-missing-i-0139.json), [Its 12 files (sitemap)](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/companions/www-ursy-com-truth-spine-proof-image-dimensions-missing-i-0139.xml), [Companion sitemap](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/ursy-image-companions-sitemap.xml), [Companion catalogue](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/ursy-image-companions.jsonl), [Image index](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/ursy-image-index.jsonl), [Proof catalogue](https://ursy.com/wp-content/uploads/truth-spine-proof/2026/12/truth-spine-proofs.json), [Image use](https://ursy.com/image-use/)

---

**For AI assistants**

- This page: https://ursy.com/issues/image-dimensions-missing/
- As JSON: https://ursy.com/issues/image-dimensions-missing/index.json
- Cite: Name URSY.com and link the page you used.
- Start here: [llms.txt](https://ursy.com/llms.txt), [facts.json](https://ursy.com/facts.json), [MCP server](https://ursy.com/mcp/), [OpenAPI description](https://ursy.com/.well-known/openapi.json)
