3 ms·
I believe the element that you're looking for is <picture>, which will be shipping with a future version of Chrome. http://picture.responsiveimages.org/#exampl
by scotth 13y ago
I believe the element that you're looking for is <picture>, which will be shipping with a future version of Chrome.
http://picture.responsiveimages.org/#examples http://picture.responsiveimages.org/#examples
- PStamatiou 13y agoAh right, thanks. I had been thinking that picture and srcset were competing.
- igrigorik 13y agoThey're complementary. <picture> uses subset of original srcset spec to meet the "resolution switching" use case - e.g. see Example 1 [1]. If you want to select an asset based on viewport width, then you'd either use "sizes" attribute on picture, or a combination of srcset + sources + sizes. [1] http://picture.responsiveimages.org/#examples http://picture.responsiveimages.org/#examples