0Pricing
HTML Academy · Lesson

Lazy Loading Images loading=lazy

Defer off-screen images with the native loading attribute.

The loading Attribute

<img loading="lazy" src="..."> tells the browser to defer downloading the image until it is about to enter the viewport. Native support across all modern browsers makes this the simplest performance win for image-heavy pages.

How "Near the Viewport" is Defined

Browsers use a small heuristic margin (usually a few thousand pixels below the fold). The image starts loading early enough that it is fully painted by the time the user scrolls to it — lazy loading is invisible to careful scrollers.

All lessons in this course

  1. The async and defer Attributes
  2. Preload Prefetch and Preconnect
  3. Lazy Loading Images loading=lazy
  4. Resource Hints modulepreload
← Back to HTML Academy