Skip to main content

HTML Guide

Free site validation

Find out what web pages on your sites are affected by HTML issues.

Bad value X for attribute “srcset” on element “source”: Must contain one or more image candidate strings.

The srcset property on source elements, when used, requires at least one value.

The <source> HTML element specifies multiple media resources for the <picture>, the <audio> element, or the <video> element. It is a void element, meaning that it has no content and does not have a closing tag. It is commonly used to offer the same media content in multiple file formats in order to provide compatibility with a broad range of browsers given their differing support for image file formats and media file formats.

The srcset attribute is required if the source element’s parent is a <picture> element, but not allowed if the source element’s parent is an <audio> or <video> element.

Learn more:

Related W3C validator issues