{{ APIRef("CSSOM") }}
CSSStyleRule
represents a single CSS style rule. It implements the {{domxref("CSSRule")}} interface with a type value of 1
(CSSRule.STYLE_RULE
).
Syntax
The syntax is described using the WebIDL format.
interface CSSStyleRule : CSSRule { attribute DOMString selectorText; readonly attribute CSSStyleDeclaration style; };
Properties
- {{domxref("CSSStyleRule.selectorText")}}
- Gets the textual representation of the selector for this rule, e.g.
"h1,h2"
. - {{domxref("CSSStyleRule.style")}} {{readonlyinline}}
- Returns the {{domxref("CSSStyleDeclaration")}} object for the rule. Read only.
Specification
Specification | Status | Comment |
---|---|---|
{{ SpecName('CSSOM', '#the-cssstylerule-interface', 'CSSStyleRule') }} | {{ Spec2('CSSOM') }} | No changes |
{{ SpecName('DOM2 Style', 'css.html#CSS-CSSStyleRule', 'CSSRule') }} | {{ Spec2('DOM2 Style') }} |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | {{ CompatVersionUnknown() }} | {{ CompatVersionUnknown() }} | {{ CompatVersionUnknown() }} | {{ CompatVersionUnknown() }} | {{ CompatVersionUnknown() }} |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{ CompatVersionUnknown() }} | {{ CompatVersionUnknown() }} |
{{ CompatVersionUnknown() }} | {{ CompatVersionUnknown() }} | {{ CompatVersionUnknown() }} |
See also
- {{CSSOM}}