<!DOCTYPE html>
...
<style scoped>
/* css */
</style>
The w3.org validator is giving me this error:
Line 883, Column 17: Element style not allowed as child of element body in this context.
(Suppressing further errors from this subtree.)
<style scoped>...
Contexts in which element style may be used:
If the scoped attribute is absent: where metadata content is expected.
If the scoped attribute is absent: in a noscript element that is a child of a head element.
If the scoped attribute is present: where flow content is expected, but before any other flow content other than inter-element whitespace and style elements, and not as the child of an element whose content model is transparent.
Content model for element body:
Flow content.
It is my understanding that the 'scoped' property makes it ok for the style tag to be outside the head of the document. So why is the validator unhappy with it?
(I'm using Wordpress and this code is produced by a plugin, which is why I can't just put it in the head.)
EDIT: This doesn't validate -
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>title</title>
</head>
<body>
<script type="text/javascript"></script>
<style scoped></style>
</body>
</html>
But it does if the script tag goes after the style tag. What is the reason for that?