LaTeX958150 views
中学数学621892 views
いろは2992226 views
小学理科717729 views
中学英語809385 views
高校日本史189979 views
りんご196284 views
ヒストリア285364 views
英語609049 views
数学講師2860658 views

JavaScript Lecture

Lazy Loading in HTML img tag

The loading attribute in the __img__ tag is used to control how and when images are loaded on a webpage.
<img src="image.jpg" loading="lazy">

When an image has the loading=“lazy” attribute, the browser will defer loading the image until it is near the viewport.

This is especially useful for pages with many images that are not immediately visible. It helps reduce initial page load time and saves bandwidth, as images below the fold (the part of the page not initially visible) are not loaded until needed.