-
The
picture
element contains zero or moresource
elements and oneimg
element to offer alternative versions of an image for different display/device scenarios -
The browser will consider each child
source
element and choose the best match among them -
If no matches are found—or the browser doesn't support the
picture
element—the URL of theimg
element'ssrc
attribute is selected -
The selected image is then presented in the space occupied by the
img
element -
The
img
element must be present, and should appear last ( after the finalsource
element) -
The image defined in a matching source element is substituted into the
src
attribute of theimg
element -
The
picture
element itself does not display anything; it merely provides a context for its containedimg
element that enables it to choose from multiple URLs width
andheight
are defined by theimg
element values