Image Aspect Ratio

Checks if images have width and height attributes to prevent layout shift.

What is this check?

This check ensures your `<img>` tags have `width` and `height` attributes specified.

Why is it important?

When you provide these attributes, the browser knows the image's dimensions before it even loads. This allows the browser to reserve the correct amount of space in the layout, preventing the content from 'jumping' or shifting around as images load.

What is the impact?

Missing width and height attributes are a primary cause of Cumulative Layout Shift (CLS), a core web vital metric that directly impacts your SEO ranking. A high CLS score indicates a poor user experience.

Example Implementation

<img src="photo.jpg" width="800" height="600" alt="An image with dimensions">