CSSStyleRule

CSSStyleRule represents a single CSS style rule. It implements the CSSRule interface with a type value of 1 (CSSRule.STYLE_RULE).

SyntaxEdit

The syntax is described using the WebIDL format.

interface CSSStyleRule : CSSRule {
    attribute DOMString selectorText;
    readonly attribute CSSStyleDeclaration style;
};

PropertiesEdit

CSSStyleRule.selectorText
Gets the textual representation of the selector for this rule, e.g. "h1,h2".
CSSStyleRule.style Read only
Returns the CSSStyleDeclaration object for the rule. Read only.

SpecificationEdit

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.
Recommendation  

Browser compatibilityEdit

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (Yes) (Yes) (Yes) (Yes) (Yes)

Document Tags and Contributors

 Contributors to this page: fscholz, harth, QFish, teoli, kscarfone, Sheppy, rioter, Sevenspade
 Last updated by: fscholz,