---
title: "Image without width/height (or fill / aspect-ratio) (lint/img-missing-dimensions)"
description: "lint/img-missing-dimensions: The browser can't reserve space for an unsized image, so content jumps when it loads (CLS)."
canonical: https://void-design.vercel.app/rules/lint/img-missing-dimensions
lastModified: 2026-09-16
---

# Image without width/height (or fill / aspect-ratio)

`lint/img-missing-dimensions` · severity **warn** · category Lint · detected by `void lint` and `void audit`

## Why it matters

The browser can't reserve space for an unsized image, so content jumps when it loads (CLS). `next/image` with a string `src` and no dimensions fails at runtime.

## How to fix it

Add `width` and `height` attributes matching the intrinsic aspect ratio (CSS can still resize), use `fill` inside a sized parent, statically import the image, or set an `aspect-*` class.

## Example

```tsx
<img src="/avatar.webp" width={96} height={96} alt="Ada" className="size-12" />
```

## References

- https://web.dev/articles/optimize-cls#images-without-dimensions

## More lint rules

`void lint` reports 67 rules in this category. Static source checks with no browser: Tailwind v4 silent failures, Next.js 16 API traps, React render-body bugs, accessibility markup, SEO files and motion hygiene.

- `tw-arbitrary-sprawl` Many arbitrary colors / pixel values bypass the design tokens — [lint/tw-arbitrary-sprawl](https://void-design.vercel.app/rules/lint/tw-arbitrary-sprawl)
- `page-level-use-client` `"use client"` at the top of a page or layout — [lint/page-level-use-client](https://void-design.vercel.app/rules/lint/page-level-use-client)
- `heavy-import` Heavy dependency imported into client code — [lint/heavy-import](https://void-design.vercel.app/rules/lint/heavy-import)
- `img-raw` Raw `<img>` in a Next.js app — [lint/img-raw](https://void-design.vercel.app/rules/lint/img-raw)
- `image-priority-deprecated` `priority` on `next/image` is deprecated in Next 16 — [lint/image-priority-deprecated](https://void-design.vercel.app/rules/lint/image-priority-deprecated)
- `missing-alt` Image without `alt` — [lint/missing-alt](https://void-design.vercel.app/rules/lint/missing-alt)
- `google-fonts-link` Google Fonts loaded via `<link>` / `@import` — [lint/google-fonts-link](https://void-design.vercel.app/rules/lint/google-fonts-link)
- `font-display` `@font-face` without `font-display` — [lint/font-display](https://void-design.vercel.app/rules/lint/font-display)

Detected by `void lint` and `void audit`. Explain it in a terminal: `void rules lint/img-missing-dimensions`
