HTML / Element / Initial coverage

The <picture> Element

Status: Initial coverage Scope: HTML Living Standard Specification checked: 2026-09-22

Technical Summary

The picture element is not itself the displayed image. It provides multiple image sources to a child img and gives the user agent a context for choosing an image resource based on viewport, pixel density, image format, and other conditions.

Its content model is zero or more source elements followed by one img. If no source matches, or a user agent does not support picture, the final img remains the fallback basis.

Definition / Categories

ItemSpecification summary
MeaningA container that supplies multiple sources and a resource-selection context for its child img
CategoriesFlow content, phrasing content, embedded content, and palpable content
ContextWhere embedded content is expected
Content modelZero or more source elements, followed by one img; script-supporting elements are permitted in the specified positions
Tag omissionNeither the start nor end tag is omissible
Content attributesGlobal attributes only; source conditions belong to child source elements, while the displayed image and alt belong to img
DOM interfaceHTMLPictureElement

The source-selection boundary

The user agent considers source elements in document order and uses their media conditions and supported type values as selection inputs. A selected source contributes an image source set from srcset and, when relevant, sizes. Candidate selection then connects to the image-processing model, including the display slot, pixel density, and other environment conditions.

AttributeMeaning inside picture
mediaUses a media query list as a condition on the current environment
typeStates the image MIME type so an unsupported candidate can be skipped before fetching where applicable
srcsetProvides image candidates for the selected source
sizesProvides the source size for a width-descriptor source set; whether it may be omitted depends on the conditions
srcIs not used on a source child of picture; put the fallback URL on img

A source element does not represent displayed content by itself. A source inside picture also has a different attribute meaning and resource-selection algorithm from a source inside audio or video.

Art direction and resolution switching

GoalTypical modelBoundary to preserve
Different resolutions of the same compositionimg srcset sizesDo not replace candidate selection with unnecessary fixed media conditions
Different crop or compositionMultiple source media elements plus fallback imgCheck that alt and surrounding text remain valid for every candidate
Different image formatsMultiple source type elements plus fallback imgA type hint is an input to selection; it is not the same as observed fetching, decoding, or rendering

Fallback and accessibility

picture is a selection context rather than the image presentation surface. Put the image meaning in alt on the fallback img. Observe named images, empty-alt images, and the accessibility tree of the selected image without treating the container's role as the image's role.

The presence of several source candidates does not by itself mean that several images are exposed to assistive technology. Browser trees, platform APIs, and assistive technology can differ and must be registered as separate observations.

DOM Interface

const picture = document.querySelector('picture');
const sources = picture.querySelectorAll('source');
const image = picture.querySelector('img');

picture instanceof HTMLPictureElement;
sources[0] instanceof HTMLSourceElement;
image.currentSrc;

HTMLPictureElement extends HTMLElement and does not expose a dedicated API that returns the selected source. The child img's currentSrc is an observation point after selection.

Fact / Evidence

Content model, source selection, attribute conditions, fallback, and accessibility are recorded separately so that normative claims are not presented as browser observations.

Key facts and evidence locations
TypeFact / claimConditions / scopeStatusEvidence
SPECpicture supplies multiple sources to its child img and provides a selection context based on viewport, pixel density, image format, and other factors.Meaning, categories, context, content model, and DOM interface.ReviewedHTML Standard: the picture element
SPECInside picture, source attributes media, type, srcset, and sizes contribute to source sets and selection; source src is not used.The source parent is picture; media-element source behavior is separate.ReviewedHTML Standard: the source element
SPECThe final img supplies the fallback and image meaning, with alt specified on that img.No source match, unsupported format, fallback content, and accessible naming.ReviewedHTML Standard: the img element / HTML-AAM: picture
SPECResolution switching and art direction are different design choices.img srcset sizes versus picture source media/type.ReviewedHTML Standard: Images

Evidence

  1. HTML Standard: The picture element — meaning, categories, content model, HTMLPictureElement, and selection context
  2. HTML Standard: The source element — media, type, srcset, sizes, and dimension attributes inside picture
  3. HTML Standard: Images — source sets, candidate selection, display slots, pixel density, and art direction
  4. HTML Accessibility API Mappings: picture — entry point for the mapping boundary between picture and its selected img
  5. Web Platform Tests: embedded content — test directory for picture, source, img, and responsive-image behavior

Implementation Evidence

Browser source selection, currentSrc, network requests, and accessibility-tree observations are recorded separately from specification claims. No dedicated fixture has been run yet, so pending items are not presented as verified.

Fixture candidate: picture-v1 should measure media order, type filtering, srcset and sizes, the fallback img, currentSrc across viewport/DPR changes, and network requests. Named and empty-alt accessibility-tree cases should separate the selected img from the picture container.

picture element implementation evidence registry
TypeReproduction scopeRecord conditionsStatus
IMPL Source selection through media, type, srcset, and sizes; fallback; currentSrc; and network requests Record browser/version, OS, date, viewport/DPR/network conditions, picture-v1 fixture, and each result Pending / not run
WPT Tests for picture, source, responsive images, type/media conditions, and fallback Record selected files, execution environment, pass/fail, unrun reasons, and cross-browser scope

Not run yet. There is no result or test version yet.

Pending / not run
AAM picture role, accessible name of the selected img, named/empty-alt cases, and exposure of source candidates Separate browser accessibility tree, HTML-AAM, platform API, assistive technology, and cross-browser observations Pending / not run

Source selection, fetching, decoding, post-selection accessibility trees, platform APIs, and assistive-technology output can depend on browser, OS, viewport, DPR, network, and image format. A single environment's observation is not registered as universal behavior.

Coverage / Open Issues

  • ReviewedMeaning, categories, context, content model, tag omission, and HTMLPictureElement
  • ReviewedThe specification boundary among source media, type, srcset, sizes, and the img fallback
  • ReviewedResolution switching versus art direction, format selection, and the entry point for alt and accessibility mappings
  • OpenChrome, Firefox, and Safari comparisons for source selection, currentSrc, network requests, and viewport/DPR changes
  • OpenIndividual WPT runs, format-specific decode/error/fallback behavior, and dynamic source insertion, movement, or attribute changes
  • OpenComplete HTML-AAM mappings, accessibility trees, platform APIs, assistive technology, CORS, referrer policy, cache, and saved-data conditions

This is initial coverage. It records specification entry points and evidence sources, but does not claim that items marked Pending have been verified or that the entire picture element has been tested.

Related surface

For a beginner-friendly explanation of image candidates, alt, and dimensions, see the Yugien picture element page. The single-image and srcset/sizes processing model is covered by the img element. See the source element for parent-specific attributes and candidate selection, and the video element to compare media-element selection. The element-specific scope of audio remains a separate topic.