h1 {color:red;} p {color:blue;}"> h1 {color:red;} p {color:blue;}" />
Easy Tutorial
❮ Att Object Form Tag Rt ❯

HTML <style> scoped Attribute

HTML <style> Tag

Example

Using the scoped attribute to describe the style of a <div> element:

<div>
&lt;style type="text/css" scoped>
h1 {color:red;}
p {color:blue;}
</style>
<h1>This heading is red</h1>
<p>This paragraph is blue.</p>
</div>

Browser Support

The numbers in the table specify the first browser version that fully supports the attribute.

Attribute
scoped Not supported Not supported 21.0 Not supported Not supported

Definition and Usage

This attribute has been removed and is not recommended for use.

The scoped attribute is a boolean attribute.

If present, it means that the styles are intended to apply only to the style element's parent element and that element's child elements.


Differences Between HTML 4.01 and HTML5

The scoped attribute is new in HTML5.


Differences Between HTML and XHTML

In XHTML, attribute minimization is forbidden, and the scoped attribute must be defined as <style scoped="scoped" />.


Syntax

❮ Att Object Form Tag Rt ❯