When the srcset attribute has any image candidate string with a width descriptor, the sizes attribute must also be present.

When using the tag picture the following error message may appear

When the srcset attribute has any image candidate string with a width descriptor, the sizes attribute must also be present.

Most likely you tried to load several images of different resolutions but forgot to add the sizes description.

For example, in the following code, for the mobile version I load two photos to choose from: 600 pixels wide and 866 pixels wide.

Besides listing them in srcset:

srcset="photo--small-lr.jpg 600w, photo--small-hd.jpg 866w"

You also need to specify their size

sizes="(max-width: 600px) 480px, 800px"

And only then close the tag

<figure class="figure1 mt8"> <picture itemscope itemtype="http://schema.org/ImageObject"> <source media="(max-width: 600px)" type="image/jpeg" srcset=" photo--small-lr.jpg 600w, photo--small-hd.jpg 866w" sizes="(max-width: 600px) 480px, 800px"> <source media="(min-width: 601px)" type="image/jpeg" srcset="photo--large.jpg"> <img class="w100" src="photo--small-lr.jpg" alt="image from website heihei.ru" itemprop="contentUrl"/> </picture> <figcaption> Photo: HeiHei.ru </figcaption> </figure>

Ten most beautiful Norwegian women Lene Nystrom image from website www.HeiHei.ru
Photo: HeiHei.ru

Article author: Andrei Olegovich

Banner image