EN
HTML - image lazy loading
3 points
In this article, we would like to show you how to set image lazy loading using HTML.
Quick solution:
xxxxxxxxxx
1
<img src="/path/to/image.jpg" loading="lazy">
In this example, we use the loading
attribute set to lazy
to set lazy loading for images and delay their loading on the web page. This can significantly reduce the time it takes for the page to load for the first time and become fully interactive.
xxxxxxxxxx
1
2
<html>
3
<body>
4
<img src="https://dirask.com/static/bucket/1574890428058-BZOQxN2D3p--image.png" loading="lazy" />
5
<br>
6
<img src="https://dirask.com/static/bucket/1590005168287-pPLQqVWYa9--image.png" loading="lazy" />
7
<br>
8
<img src="https://dirask.com/static/bucket/1590005138496-MWXQzxrDw4--image.png" loading="lazy" />
9
<br>
10
<img src="https://dirask.com/static/bucket/1590005318053-3nbAR5nDEZ--image.png" loading="lazy" />
11
</body>
12
</html>