W3 Validator Errors with Style tags in Dawn Theme

15 1 1

Hello Shopify Gurus,


I am getting a ton of errors when using the W3 validator. The errors are caused by the embedding of <Style> tags in the Dawn theme. I got over 30 errors: Element style not allowed as child of element div in this context.


Does anyone have a solution for this or any feedback on how to fix or manage them.


This is the validator I am using: https://validator.w3.org/

This is the website I am testing NSFW: https://MyRubyLips.com




Thank you,


Reply 1 (1)

Shopify Expert
3466 280 1286

I would not pay much attention to this particular error unless you're contractually obligated to produce HTML which can be validated.

This does not really effect your site speed, look or SEO rankings because browsers are Ok with this.


The way your page is constructed from sections does not allow to easily consolidate all style content inside <head>.


In theory it should be doable in theme code, but this will require extra processing time => will negatively effect TTFB => PageSpeed => SEO. 

Also, it's highly possible that apps you may use will also add style elements in "wrong" places.



If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com