Open In App
Related Articles

HTML | scoped Attribute

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

The HTML scoped attribute is a boolean attribute that 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).
Note : It is a deprecated attribute and it is not supported by HTML5. 

Supported tag: 
 


Example: 
 

html

<!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>

                    

Output: 
 


Supported Browsers: The browsers supported by HTML scoped Attribute are listed below: 
 

  • Firefox


 


Last Updated : 27 May, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads