Will lazy-loading images avoid viewport jumping? Because that's a constant headache on mobile Safari.
max-width: 100%;
height: auto;
What the other user is talking about is a new feature that FINALLY uses the attributes to preserve the ratio before the image starts loading.Kinda ridiculous that we had to wait 8 years of “responsive design” before they realized that this was always supposed to happen.
1: https://blog.google/products/chrome/taking-aim-annoying-page...
But both Firefox and Chrome have implemented this: when your img tag contains both height and width attributes, the browsers use those to calculate the aspect ratio, and use those to reserve the correct amount of space when rendering the page.