Predict Image Lazy Loading
Predict Output Easy
Question
With loading='lazy' on images below the fold, what happens during initial page load?
Code
<img src="hero.jpg" alt="Hero">
<img src="below-fold-1.jpg" alt="Image 1" loading="lazy">
<img src="below-fold-2.jpg" alt="Image 2" loading="lazy">
Hint
Lazy loading defers loading until needed.
Explanation
loading='lazy' tells the browser to defer loading images until they are near the viewport. Only the hero image (without lazy) loads immediately. The below-fold images load as the user scrolls toward them, reducing initial page load time and saving bandwidth.
Related Resources
Related Lessons
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.