Title: Lazy loading &amp; HTML Validation
Last modified: August 19, 2020

---

# Lazy loading & HTML Validation

 *  Resolved [Fropky](https://wordpress.org/support/users/fropki/)
 * (@fropki)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/lazy-loading-html-validation/)
 * Hi,
 * When i try to validate html I get this error. Should I Ignore
 * Error: Element style not allowed as child of element noscript in this context.(
   Suppressing further errors from this subtree.)
    From line 403, column 11; to 
   line 403, column 17 <noscript><style>.lazyl Contexts in which element style may
   be used: Where metadata content is expected. In a noscript element that is a 
   child of a head element. Content model for element noscript: When scripting is
   disabled, in a head element: in any order, zero or more link elements, zero or
   more style elements, and zero or more meta elements. When scripting is disabled,
   not in a head element: transparent, but there must be no noscript element descendants.
   Otherwise: text that conforms to the requirements given in the prose.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/lazy-loading-html-validation/#post-13282998)
 * I would ignore that, yes, but if you really want then search this forum because
   a workaround for this was provided already (a code snippet hooking into Autoptimize’s
   API to remove those offending elements).
 * hope this helps,
    frank
 *  Thread Starter [Fropky](https://wordpress.org/support/users/fropki/)
 * (@fropki)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/lazy-loading-html-validation/#post-13283053)
 *     ```
       add_filter('autoptimize_filter_imgopt_lazyload_cssoutput','no_noscript');
       function no_noscript() {
           return '<style>.lazyload,.lazyloading{opacity:0;}.lazyloaded{opacity:1;transition:opacity 300ms;}</style>';
       }
       ```
   
 * So does this code completely shuts lazy loading in case javascript not present?(
   Just thinking from search bot perspective)
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/lazy-loading-html-validation/#post-13283082)
 * you can update the code to `return '';` as the CSS in the return in fact has 
   been removed from AO.
 * what happens in case no JS is executed if you do that is that there will be an
   both an empty image placeholder and the original image (from the noscript-tag).
   what the bots might think if that I don’t know really … 😉

Viewing 3 replies - 1 through 3 (of 3 total)

 The topic ‘Lazy loading & HTML Validation’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/lazy-loading-html-validation/#post-13283082)
 * Status: resolved