Element <style> not allowed as child of element <div> in this context

I noticed after check my page code this [style] tag between [div] at the [foot] tag!

I did some research, and some people say it’s Ok, and others say it is wrong. Why doesn’t xTheme set this [style] tag at the [head] tag as supposed to?

Also, I see that xTheme still adding the type attribute for the style element which is not needed and should be omitted.

What’s your thought about that?

Best,

Robert

Hi Robert,

Thanks for reaching out.

It should be okay and no problem, please check this https://stackoverflow.com/questions/27539084/element-style-not-allowed-as-child-of-element-body-in-this-context-style-scope. That’s to prevent child element having <style> where it has a specific scope. And since scoped is dropped then there should be no issue placing it within div anymore.

Thanks!

I see.
Why xTheme does not keep all CSS styles in a separate file and load it at the begging as supposed to?

Best,

Robert

Hello Robert,

This is the order of the styles being loaded in the theme:

  • stack theme style.css file
  • child theme’s style.css

Other css styles were not loaded in a separate file because it is coming from the theme options or custom css like the following:

  • WordPress Custom CSS (Appearance > Customizer > Additional CSS)
  • Theme Option settings
  • Theme Option’s custom css
  • Cornerstone page’s custom css

Hope this explains it briefly.

yes. indeed. tks

We are delighted to assist you with this.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.