In previous articles I’ve addressed why we need responsive images (fluid design plus screen pixel densities) and looked at the
<picture> element, while conducting investigations of the
x descriptors. Today I’ll explain the
sizes attribute, the trickiest part of the new specification.
sizes is… odd. It looks weird. It acts weird. But it is the final missing piece of the spec, the part that brings everything together, and therefore key to understanding responsive image syntax.
If there’s one thing to keep in mind about
sizes, it’s this:
sizes expresses the designer’s intentions for the image. It does so with a little bit of math, for one reason…