Avoiding <img> layout shifts: aspect-ratio vs width & height attributes
https:/
Layout shifts are a real annoyance on most sites, so please, read this new gem from Jake, about preventing images layouut shifts the right way… or the right ways actually.
For over a decade, we had to use silly hacks to manually apply an aspect ratio, and then, bloody typical, two better solutions arrived at roughly the same time. They are CSS
aspect-ratio
, andwidth
&height
presentational hints.