smus Posted August 1, 2018 Share Posted August 1, 2018 (edited) I tested the code on Firefox, but it also applies styles for the rest of the HTML file: <div> <style scoped> h1 {color:red;} p {color:blue;} </style> <h1>This is a heading</h1> <p>This is a paragraph.</p> </div> <h1>This is a heading</h1> <p>This is a paragraph.</p> Edited August 1, 2018 by smus Link to comment Share on other sites More sharing options...
Ingolme Posted August 1, 2018 Share Posted August 1, 2018 I tested and the scoped attribute does not work. According to MDN, Firefox should support it, but it also says that the attribute is deprecated so it's best not to use it. Since the scoped attribute is deprecated, <style> elements should only go in the <head> section of the document. 2 Link to comment Share on other sites More sharing options...
smus Posted August 2, 2018 Author Share Posted August 2, 2018 Excellent! Thanks, Ingolme! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now