Images without width and height attributes can cause layout shifts and negatively impact Core Web Vitals (CLS).
By Seoxpert Editorial · Published
When images lack explicit width and height attributes, browsers cannot reserve the correct space before the images load. This often causes layout shifts as images appear, leading to a poor user experience and negatively affecting the Cumulative Layout Shift (CLS) metric, a key factor in Google's Core Web Vitals.
Leaving this unresolved can harm user experience and lower your site's Core Web Vitals score, potentially affecting SEO rankings.
An automated crawler scans HTML for <img> tags missing width and height attributes.
Problem: Missing width and height
<img src="photo.jpg" alt="A photo">Fix: Add explicit width and height
<img src="photo.jpg" width="800" height="600" alt="A photo">Width and height attributes reserve space in the layout before the image loads, preventing layout shifts. CSS can still override the display size.
No, width and height attributes must be pixel values matching the image's natural dimensions. Use CSS for responsive scaling.
Check the image file properties or inspect it in your browser to find its natural width and height in pixels.
Yes, dynamically inserted images should also have explicit width and height attributes set in the HTML or via JavaScript.
Run a scan to see if Images Without Explicit Dimensions affects your pages.
Scan my website →