3311 shaares
1 private link
1 private link
By default, an <img> takes up zero space until the browser loads enough of the image to know its dimensions.
To workaround this, we can use the width
and height
attributes, or the aspect-ratio
CSS property. Which is best? Depend if the image is content or design!