According to the MDN page on style, browser support is abysmal, so it shouldn't be used on public webpages because of incompatibility issues.
That much is clear. Not asking about that.
But how about the official definition?
The MDN page says you can use <style> in the head, and <style scoped> in the body (or more formally, anywhere that flow content is possible).
The W3C on the other hand, makes no such distinction; it says you can use <style> in "any element that can contain metadata elements, div, noscript, section, article, aside" and doesn't mention that scoped changes the content category.
So am I missing something?
Oh, I can't get the W3C validator to work with <style scoped>. A quick and dirty test like this
Code: Select all
<!DOCTYPE html>
<title>test</title>
<body>
<p>test 1</p>
<div>
<style scoped>p {background:lime}</style>
<p>test 2</p>
</div>