Add `width` and `height` Attributes to Images to Prevent Layout Shift

Performance Analyzer

What is this warning?

An image on your page is missing `width` and `height` attributes. Without these, the browser doesn't know how much space to save for the image while it's loading. When the image finally appears, it pushes other content around, causing a jarring 'layout shift.' This is a poor user experience and is measured by the Cumulative Layout Shift (CLS) Core Web Vital.

How to Fix This Issue

How to Fix It

The Problem

<img src="logo.png" alt="Company Logo">

The Solution

Always include the `width` and `height` attributes on your `<img>` tags, matching the dimensions of the image file.

<img src="logo.png" alt="Company Logo" width="200" height="50">

Why This Works

These attributes allow the browser to reserve the correct amount of space in the layout before the image has even downloaded, completely preventing the layout shift. This is a critical fix for improving your CLS score.

SEO Impact

This issue can affect your site's search engine rankings and user experience. Addressing it promptly helps ensure optimal performance and visibility in search results.

Automatic Detection

Black SEO Analyzer automatically checks for this warning during site analysis, along with hundreds of other technical SEO issues.

Ready to Unlock Your Site's Full SEO Potential?

Choose the license that fits your needs and start getting the deep, actionable insights you deserve.