srcset and sizes
Widely available since 2019-09-27
The srcset
and sizes
attributes for <img>
elements set a list of possible sources for the image and a corresponding list of size conditions for choosing a source, to show a responsive image that fits the size of the display.
Learning resources on MDN
No MDN documentation found. You can search for the feature on MDN. If you believe that MDN has no documentation about this feature, you can open an issue on MDN's GitHub repository.Browser support (view on caniuse.com)
- Chrome 38 Released on 2014-10-07
- Chrome Android 38 Released on 2014-10-08
- Edge 13 Released on 2015-11-12
- Firefox 38 Released on 2015-05-12
- Firefox for Android 38 Released on 2015-05-12
- Safari 10.1 Released on 2017-03-27
- Safari on iOS 10.3 Released on 2017-03-27
Specifications
- HTML (#attr-img-srcset), from HTML Workstream (WHATWG).
View web-platform-tests results for this feature - View the feature source file (dist) - Edit the feature - Report an issue about this feature