🌐Lazy Loading
Also known as Lazy Load, loading="lazy", Deferred Loading
Pictures and code that load late, just as the reader gets near them.
Think of it like
It is like a waiter who brings each dish just when you want it.
Example
Lucy's photo blog has 60 pictures per page. With lazy loading, only the first few load, and the page opens in a second.
Why it matters
A faster first view keeps readers on the page. People on phones also save data they would never have used.
Definition
Example code
html
<img src="beach.jpg" alt="Waves on a sandy beach" loading="lazy">Common mistake
Key takeaways
- 1Load when near. Fetch just before it comes into view.
- 2Faster first view. The top of the page comes first.
- 3Not the top picture. Load what is seen at once right away.