Lazy loading: fix typo and added color highliting to html code

This commit is contained in:
Marco D'Agostini 2020-09-24 20:03:12 -05:00
parent c6476f4071
commit 6a18656323

View File

@ -1,8 +1,10 @@
# Lazy loading images in HTML # Lazy loading images in HTML
To implement [[Lazy Loading]] to an `<img ... >` tag, add the attrbitue `loading=lazy` To implement [[Lazy Loading]] to an `<img ... >` tag, add the attribute `loading=lazy`
<img loading=lazy ... > ```html
<img loading=lazy ... >
```
This will load the image when scrolling is near the viewport, using the [Intersection Observer API](https://developers.google.com/web/updates/2016/04/intersectionobserver) This will load the image when scrolling is near the viewport, using the [Intersection Observer API](https://developers.google.com/web/updates/2016/04/intersectionobserver)