Skip to Content
OpportunitiesTechnicalSite IssuesImagesMissing Size Attributes

Missing Size Attributes

What This Means

Image elements without dimensions (width and height size attributes) specified in the HTML. This can cause large layout shifts as the page loads and be frustrating experience for users. It is one of the major reasons that contributes to a high Cumulative Layout Shift (CLS).

What Triggers This Issue

This issue is triggered when image elements on a page lack specified dimensions (width and height size attributes) in the HTML. For example:

<img src="/example.jpg"> Where width and height are not defined. Here’s how images should should appear in the HTML with width and height attributes. <img src="/example.jpg" width="300" height="600">

How To Fix

Define all images native size using width and height attributes in the HTML. This allows the browser to calculate enough space for the image before it loads avoiding large layout shifts.


← Back to Images

Last updated on