Lazy loading: fix typo and added color highliting to html code
This commit is contained in:
parent
c6476f4071
commit
6a18656323
|
@ -1,8 +1,10 @@
|
|||
# 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`
|
||||
|
||||
```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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user