HTML Guides for lazy loading
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
The loading attribute on an iframe element accepts only lazy or eager, so an empty value like loading="" or any other word is invalid.
With eager, the browser loads the frame right away, which is also what happens when the attribute is missing. With lazy, it waits until the frame gets close to the viewport, which saves bandwidth for embeds further down the page. The empty string is not one of these keywords. Browsers treat it as an invalid value and fall back to eager loading, so the attribute does nothing except fail validation. Values such as true or auto trigger the same error.
An empty loading="" usually comes from a template or CMS plugin that prints the attribute even when its lazy-loading option is off. Fix it where the markup is generated: output loading="lazy" when you want the frame deferred, and leave the attribute out otherwise.
Invalid example
<iframe src="https://example.com/embed/map" title="Store location map" loading=""></iframe>
Valid example
Defer the frame until the user scrolls near it:
<iframe src="https://example.com/embed/map" title="Store location map" loading="lazy"></iframe>
Or drop the attribute to load it right away:
<iframe src="https://example.com/embed/map" title="Store location map"></iframe>
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
1K Weekly
1,000 monthly checks. Cancel anytime.
Get 1K Weekly →Join teams across 40+ countries