Skip to main content

HTML Guide

The “sizes” attribute may be specified only if the “srcset” attribute is also present.

The sizes attribute is used to complement the srcset attribute on an <img> tag for responsive images, therefore it’s not valid if srcset is missing.

Learn more:

Last reviewed: March 14, 2023

Was this guide helpful?

Related W3C validator issues