Skip to main content
Login Join
Snippet · HTML

Lazy Load Images (HTML5)

Shared by Mukesh Gujjar · July 26, 2026

1 view
Back to Snippets

Improve page loading performance by delaying image loading until the image enters the viewport.

 

 

Usage

Simply add the loading="lazy" attribute to any <img> element.

Best For

<img
    src="image.jpg"
    alt="Beautiful Landscape"
    loading="lazy"
    width="800"
    height="600">
Know a different way to do this? Add your approach as a variation so folks can compare them side by side.
Submit a variation

0 comments