HTML | scoped Attribute
The HTML scoped attribute is a boolean attribute which is used to specify that the styles only apply to this element’s parent element and that element’s child elements (not the entire document).
Supported tag:
- style
Example:
<!DOCTYPE html> < html > < head > < style > </ style > </ head > < body > < center > < div > < style scoped> h1 { color: green; } h2 { color: black; } </ style > < h1 style = "red" >GeeksforGeeks</ h1 > < h2 >HTML scoped attribute</ h2 > </ div > </ center > </ body > </ html > |
chevron_right
filter_none
Output:
Supported Browsers: The browsers supported by HTML scoped Attribute are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Apple Safari
- Opera