Negotiate an alternative image
The picture element allows the browser and server to negotiate which version of an image to use.
The picture element supports different sized versions of the same image for optimal display on desktops, laptops, tablets and cellphones with different display sizes and resolutions.
The picture element is a wrapper for one "img" element and multiple "source" elements.
The img element specifies most of the attributes to use like height, width, assistive technology alt text, etc.
Each source element specifies an alternate version of the image to be used on devices with higher resolutions or different sized screens or support for different content types.
- The picture element does not have any special attributes.
- Use attributes on the img element to specify image settings such as:
- Use attributes on each of the source elements to specify
- The img element is used to display a photograph or graphic drawing within a document.
- Each source element provides one version of a media file, allowing the browser to negotiate which one to use.