emptygif
Langue: Français

Tous les langages et frameworks

Lazy-loading placeholder (lazysizes) HTML

Un extrait HTML pour Lazy-loading placeholder (lazysizes) qui répond aux requêtes sur /pixel.gif avec le GIF vide, décodé une seule fois au démarrage.

Lazy-loading placeholder (lazysizes) HTML

Fichier
index.html
<!-- The empty GIF keeps src valid until lazysizes swaps in data-src.
     (For most pages today, native loading="lazy" is enough.) -->
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
     data-src="/images/photo.jpg" class="lazyload"
     width="800" height="600" alt="A photo">

Nous avons exécuté cet extrait et comparé les octets qu’il a renvoyés.

Site officiel: Lazy-loading placeholder (lazysizes)

Autres extraits en HTML