Eric Portis avatar Eric Portis

Sizes="auto" pretty much requires width and height attributes

Screenshot of “Sizes="auto" pretty much requires width and height attributes”

sizes="auto" is a great new feature of HTML for lazy loaded responsive images.

are we dealing with an with sizes=auto? Then its natural dimensions are 300×150. NO EXCEPTIONS.

But this is not an issue, because you already have width and height attributes in your HTML, right?

Right?

  1. Note from 4 April 2024

    Most mentions of the magical CSS object-fit: cover; in development tutorials should be accompanied by a warning: in most situations, it means the browser will download an image that is larger than required (at least in one direction), and optimization on the server side could be a better option.