Get the latest tech news

How to think about HTML responsive images


srcset, sizes, picture, source, and how they all fit.

But what the HTML Standard is concerned with, and what this article talks about, are the so-called “adaptive images” enabled by the srcset and sizes attributes on<img>, and the dedicated<picture> and<source> elements. The src attribute on the<img> is both a fallback for browsers that don’t support srcset(a vanishingly small lot) and a contribution to the set of image source candidates with an implicit 1x pixel density descriptor. As Eric Portis explains, you don’t want to rely on that default, as it potentially nudges the browser to fetch images much larger than needed, defeating the whole purpose of the feature.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of HTML

HTML

Photo of responsive images

responsive images