Skip to content

Lazy loading images with HTML

It’s time to stop using JavaScript to lazy load images. Set the loading attribute on <img> tags to lazy. The browser will load the image when the user scrolls to image. This attribute works with <iframe> too.

<img src='image.jpg' loading='lazy' alt='Alt text...'>

I’ll be available for long-term projects from July 2023. Meanwhile, open for smaller projects.

Get in touch