Add the `sizes` Attribute to Responsive Images for Faster Loading

Mobile Analyzer

What is this warning?

You're using the `srcset` attribute to provide different image sizes, but you're missing the `sizes` attribute. The `sizes` attribute tells the browser how wide the image will be displayed at different screen sizes. Without this hint, the browser has to wait until it has loaded the CSS to figure out which image to download, which can slow down your page load.

How to Fix This Issue

How to Fix It

The Problem

<img srcset="image-480w.jpg 480w, image-800w.jpg 800w">

The Solution

Add a `sizes` attribute that describes the rendered width of the image. For example, if an image is full-width on mobile and half-width on desktop:

<img srcset="image-480w.jpg 480w, image-800w.jpg 800w"
     sizes="(min-width: 800px) 50vw, 100vw">

Why This Works

The `sizes` attribute allows the browser to start downloading the correct image source immediately, without waiting for CSS. This is a powerful optimization that can significantly speed up image loading and improve your Largest Contentful Paint (LCP) 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.