CSS Portal

HTML <picture> Tag

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The <picture> element in HTML is a container used to provide multiple sources for an image, allowing the browser to choose the most appropriate one based on factors like screen size, resolution, or format support. It is part of the responsive images feature in HTML5 and is especially useful for optimizing performance and delivering the best visual experience across different devices.

Unlike a standard <img> element, which displays a single image file, <picture> allows developers to define several <source> elements within it. Each <source> element can specify a different image file and media query conditions, enabling scenarios such as loading smaller images for mobile devices, higher-resolution images for retina displays, or modern formats like WebP when supported.

The <picture> element always contains an <img> element as its last child. This <img> serves as a fallback if none of the specified <source> elements match the current device conditions or if the browser does not support the <picture> element. This ensures backward compatibility while providing enhanced functionality for capable browsers.

Properties

Permitted Parents
Any element that allows embedded content
Content
Zero or more <source> elements, followed by one <img> element, optionally intermixed with script-supporting elements
Start/End Tags
Start tag: required, End tag: required

Example

<picture>
<source srcset="images/color.svg">
<img src="images/color.png" width="256" height="256" alt="Color">
</picture>

Attributes

None

Global Attributes

The <tr> tag also supports the Global Attributes in HTML5

Event Attributes

None

Browser Support

The following information will show you the current browser support for the HTML <picture> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.

This tag is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 26th December 2025

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!