Why can’t <style> tags within the HTML <body> tag validate on W3C?

chris picture chris · Jan 26, 2011 · Viewed 25.3k times · Source

Possible Duplicate:
Does <STYLE> have to be in the <HEAD> of an HTML document?

I am part of a team that has developed a CMS system.

We would like to be able to insert <style> tags within the <body> of an HTML page in a way that validates to W3C standards, as validation is a requirement of our SEO consultant.

The style tag functions perfectly well within the body tag across all browsers, yet it refuses to validate.

Answer

Spliffster picture Spliffster · Jan 26, 2011

The HMTL DTD does not allow it, therefore it doesn't validate. Doesn't matter, all browsers support it anyway.