• Hi,

    I’ve noticed that this plugin appends its <style> element to the <body>.

    Even if this works in almost any browser I’ve trued, HTML5 standard does not allow <style> elements in <body>, so you will experience a validation error if you try to submit your page at https://validator.w3.org/nu/

    
    Error: Element style not allowed as child of element body in this context. (Suppressing further errors from this subtree.)
    
    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.
    

    The fix should be easy and should not break compatibility: it is enough to enqueue the style element to the head instead of the footer (plugin_frontend.php, line 46).

    Ref: https://html.spec.whatwg.org/multipage/semantics.html#the-style-element

    • This topic was modified 5 years, 3 months ago by giti.
    • This topic was modified 5 years, 3 months ago by giti. Reason: add link to standard
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Style attribute in body is not allowed by HTML’ is closed to new replies.