Skip to main content

HTML Guide

Bad value X for attribute “srcset” on element “source”: No width specified for image Y. (When the “sizes” attribute is present, all image candidate strings must specify a width.)

The sizes attribute is used to complement the srcset attribute on an <img> tag for responsive images. When this attribute is present, all image candidates must specify its width.

Learn more:

Last reviewed: October 27, 2022

Was this guide helpful?

Related W3C validator issues