CSS <style scoped> applies outside of the scope
css, html
Solution
You are not doing anything wrong. As of this moment, scoped CSS is still an experimental feature which is not supported by any current browser.
However, if you want to play around with it in Chrome you can do the following thing:
- Go to chrome://flags/ in your Chrome browser;
- Find "Enable experimental WebKit features." and click enable
- Restart your browser.
- Try your code. It should work.
Problem
The most simple example of scoped style doesn't work in Chrome (v 25): ``` <div> <h1>Hello 1</h1> </div> <div> <h1>Hello 2</h1> <style scoped> h1 { color: red; } </style> </div> ``` Try it: http://jsfiddle.net/RWW8r/2/ Both `h1` become red: The scope style should only apply to the second `h1`. I read that the functionality was implemented in Chrome, why doesn't that work? Am I doing something wrong?