PageSpeed: Image Elements Do Not Have Explicit Width & Height

back to issues overview

Image Elements Do Not Have Explicit Width & Height

Pages that have images without dimensions (width and height size attributes) specified in the HTML. This can be a big cause of poor CLS.

How to Analyse in the SEO Spider

To populate this filter the PageSpeed Insights API must be connected via ‘Config > API Access > PSI’.

View URLs with this issue in the ‘PageSpeed’ tab and filter and use the lower ‘PageSpeed Details’ tab to click on the issue on the left-hand side, and see details of the images on the right-hand side.

Bulk export the pages, images and specific HTML code snippets via ‘Reports > PageSpeed > Image Elements Do Not Have Explicit Width & Height’.

What Triggers This Issue

This issue is triggered when pages have images without specified dimensions (width and height attributes) in the HTML.

How To Fix

Always include width and height size attributes on your images and video elements.

Alternatively, reserve the required space with CSS aspect ratio boxes. This approach ensures that the browser can allocate the correct amount of space in the document while the image is loading.

Back to top