<picture>: The PICTURE Element
Last updated: 2026-10-13
<picture>The PICTURE Element
Provides multiple image sources for an img, letting the browser pick the best one by viewport, resolution, etc.
| Category | Links & Media |
|---|---|
| Content Model | Flow content |
| Allowed Parents | Any element that accepts flow content |
| Content Tag | Yes — requires closing </picture> tag |
| Status | Standard |
📝 Syntax
<picture>image sources</picture>
▶ Example
Edit the code below and see the live result in the playground:
🌐 Browser Support
| Browser | |||||
|---|---|---|---|---|---|
| <picture> | ✓ v1 | ✓ v12 | ✓ v1 | ✓ v1 | ✓ v1 |
| Supported in all major browsers | |||||
Tip: picture must contain an img as fallback; source only chooses, the img is always what renders.
❓ FAQ
QWhat is the difference between picture and img?
A
<picture> is a 'format/crop selector' for img: it holds several <source> elements plus one fallback <img>, and the browser picks the best resource (newer format, different crop). img alone loads a single resource. Note that picture renders nothing itself — the swapping happens on the img.QHow do I provide a WebP fallback with picture?
APut the new format in source and the old one in img:
<picture><source type='image/webp' srcset='a.webp'><img src='a.jpg' alt='…'></picture>. WebP-capable browsers pick the source; the rest fall back to the jpg in img.QHow does the media attribute of picture work?
APut a media query on source to serve different crops per screen:
<source media='(max-width: 600px)' srcset='small.jpg'>. The first matching source wins, evaluated in document order; the fallback is always the img.🏷️ Related Tags
💡 Related Cases
More case studies coming soon — check back later.