knowledge/Lazy loading images in HTML.md
2020-08-04 13:00:36 -05:00

579 B

Lazy loading images in HTML

To implement Lazy Loading to an <img ... > tag, add the attrbitue loading=lazy

<img loading=lazy ... >

This will load the image when scrolling is near the viewport, using the Intersection Observer API

Further reading

What led to learning this