knowledge/Lazy loading images in HTML.md
Marco D'Agostini 95782bbca6 Added missing tag header to some documents
Added `english` / `spanish` tags and added `english` tag to template
2021-02-24 17:10:55 +01:00

702 B

tags
knowledge, frontend, lazy-load, english

Lazy loading images in HTML

To implement Lazy Loading to an <img ... > tag, add the attribute 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

Accidentally: a rabbit hole that started at Jason Crawford's github and ended at an issue in the owid-grapher repo