Lazy loading is always a important part of web page optimization. Now, Chrome has support this feature.

Its pretty simple to use this feature, juat add loading="lazy" to img tag, and browser will lazy load image automatically.

Online demo:

See the Pen by (@justforuse) on CodePen.

Open developer tools, you can when you scroll down, the image will be loaded.

Besides, you can also add this to iframe tag, it will lazy load iframe page.

Reference: https://web.dev/native-lazy-loading

Compatibility:

Can I Use loading-lazy-attr? Data on support for the loading-lazy-attr feature across the major browsers from caniuse.com.


πŸ‘‡ Please leave your comment if you like this.πŸ‘‡