lazy loading images code example

Example 1: html lazy loading images

<img loading="lazy" src="https://via.placeholder.com/320x200" alt="Lazy loaded image" />

Example 2: how to make images load as you scroll down

<img loading="lazy" src="https://example.com" />

Example 3: html lazy load images

<img src="image.png" loading="lazy" alt="" style="height:200px; width:200px;">

Example 4: how to add lazy loading in html

lazy loading in html

<img src="myimage.jpg" loading="lazy" alt="..." />
<iframe src="content.html" loading="lazy"></iframe>

Example 5: Lazy laoding of images

<img data-src="image.jpg" alt="test image">

Example 6: angular lazy loading images

mport { Component } from '@angular/core';@Component({  selector: 'image',  template: `    <img [defaultImage]="defaultImage" [lazyLoad]="image">  `})class ImageComponent {  defaultImage = 'https://www.placecage.com/1000/1000';  image = 'https://images.unsplash.com/photo-1443890923422-7819ed4101c0?fm=jpg';}

Tags:

Html Example