Web platform features explorer

srcset and sizes

Widely available since 2019-09-27
Tags: api html Groups: HTML

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.

Specifications

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