English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Das Attribut "scoped" ist ein boolesches Attribut. Wenn das Attribut "scoped" verwendet wird, wird der Style nur auf den Elternelement und die Kinder des style-Elements angewendet.
Verwenden Sie das Attribut "scope", um die Stylesheet des <div>-Elements zu beschreiben:
<div> <style type="text/css" scoped> h1 {color:yellow;} p {color:green;} </style> <h1>This title is yellow</h1> <p>This paragraph is green.</p> </div>Test see ‹/›
attribute | |||||
---|---|---|---|---|---|
scoped | Not supported | Not supported | 21.0 | Not supported | Not supported |
The scoped attribute is a boolean attribute.
If the scoped attribute is used, the style is only applied to the parent element of the style element and its child elements.
The scoped attribute is an HTML5 new attributes added.
In XHTML, attributes are not allowed to be abbreviated, the scoped attribute must be defined as: <style scoped="scoped" />。
<style scoped>HTML <style> Tag