References

Collection of references for web development.

HTML picture tag

Description

The HTML <picture> element represents a container used for specifying one or more image resources, commonly used to serve the same image but at different sizes for different devices.

Attributes

Attribute Value Description
name string Specifies the name of the element.
value value Specifies the value of the element.

Example

<picture>
	<source media="(min-width: 600px)" srcset="https://via.placeholder.com/300x150">
	<source media="(min-width: 300px)" srcset="https://via.placeholder.com/150x50">
	<img src="https://via.placeholder.com/450x200" alt="Placeholder">
</picture>