Resource Loading

loading="lazy"

Allows the browser to defer a resource until it approaches the viewport. Avoid using it on the likely largest above-the-fold image; supply image dimensions to reduce layout shifts. On img and iframe, and on audio and video in the current HTML Living Standard; media-element implementation must be checked separately. For these elements, missing or invalid values default to eager. Browser heuristics determine actual timing. The example uses a tiny inline asset, not a network benchmark.

Formal Syntax & Structure

html syntaxhtml
loading="lazy"

Parameters & Attributes

NameTypeDescription
loadingkeywordAllows the browser to defer a resource until it approaches the viewport. Avoid using it on the likely largest above-the-fold image; supply image dimensions to reduce layout shifts.

Working Example

Example Snippethtml
<img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNjAiIGhlaWdodD0iMTAwIj48cmVjdCB3aWR0aD0iMTYwIiBoZWlnaHQ9IjEwMCIgZmlsbD0ibGlnaHRibHVlIi8+PGNpcmNsZSBjeD0iODAiIGN5PSI1MCIgcj0iMzAiIGZpbGw9Im5hdnkiLz48L3N2Zz4=" alt="Blue circle on a light blue background" width="160" height="100" loading="lazy">
HTML Reference