HTML Validation
HTML Guides for 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 the img element only accepts the values eager or lazy.
The loading attribute is used to specify lazy loading behavior for images and only accepts the values "lazy" or "eager" (which is the default).
Explanation:
- The loading attribute hints to the browser whether to load the image immediately ("eager"), defer until it reaches a calculated distance from the viewport ("lazy").
- Using values other than "lazy", "eager" results in validation errors and browsers ignore the attribute.
- Never use numeric values or case-variants; always use the lower-case string values above.
Incorrect Example:
<img src="logo.png" alt="Company logo" loading="1">
Correct Example:
<img src="logo.png" alt="Company logo" loading="lazy">
Replace the incorrect value with loading="lazy" or loading="eager", or remove the attribute, to resolve the validator issue.
Ready to validate your sites?
Start your free trial today.