Issue Bug Closed

#63107Resposive Images: source element within picture element has wrong src attribute

Arnd Messer 11/20/14, 19:22 updated 10/02/18, 11:49

Description

The source element when used within the picture element must use the srcset attribute. The src attribute must not be present.

<picture>
    <source srcset="images/large.jpg" media="(min-width: 1000px)">
    <source srcset="images/medium.jpg" media="(min-width: 800px)">
    <img src="images/small.jpg" alt="a picture">
</picture>

http://www.w3.org/html/wg/drafts/html/master/embedded-content.html#the-picture-element

One site effect ist, that picturefill did not work out of the box, as it requires a standard html5 element.
http://scottjehl.github.io/picturefill/#using-picture

Reviews 2