By adding the loading="lazy" attribute to your images and iframes, you can defer loading offscreen content until the user scrolls near it. This simple change can significantly improve your website’s performance, especially on pages with multiple images.
It’s a quick win that boosts your site’s speed with minimal effort. Have you tried lazy-loading in your projects? Share your experiences or tips in the comments below!
Top comments (1)
The loading attribute with the value lazy can also be used with the iframe element. Add it, for example, with the embed code of a YouTube video (it's not added automatically by YouTube, as explained on this page).