CSSStyleRule represents a single CSS style rule. It implements the CSSRule interface with a type value of 1 (CSSRule.STYLE_RULE).
The syntax is described using the WebIDL format.
interface CSSStyleRule : CSSRule {
attribute DOMString selectorText;
readonly attribute CSSStyleDeclaration style;
}; CSSStyleRule.selectorText"h1,h2".CSSStyleRule.styleCSSStyleDeclaration object for the rule.| Specification | Status | Comment |
|---|---|---|
| CSS Object Model (CSSOM) The definition of 'CSSStyleRule' in that specification. | Working Draft | No changes |
| Document Object Model (DOM) Level 2 Style Specification The definition of 'CSSRule' in that specification. | Obsolete |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | Yes | Yes | Yes | 9 | Yes | Yes |
selectorText |
Yes | Yes | 61
|
9 | Yes | Yes |
style |
Yes | Yes | Yes | 9 | Yes | Yes |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | Yes | Yes | Yes | Yes | Yes | Yes | ? |
selectorText |
Yes | Yes | Yes | 61
|
Yes | Yes | ? |
style |
Yes | Yes | Yes | Yes | Yes | Yes | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleRule