CSSRule — a rule in a CSS stylesheet
A CSSRule object represents a rule in a CSSStyleSheet: it represents style information to
be applied to a specific set of document elements.
selectorText is the string representation
of the element selector for this rule, and
style is a CSSStyleDeclaration object that represents the set
of style attributes and values to apply to the selected
The CSS Object Model specification actually defines a hierarchy of CSSRule subtypes to represent different kinds of rules that can appear in a CSS stylesheet. The properties listed here are properties of the generic CSSRule type and of its CSSStyleRule subtype. Style rules are the most common and most important types of rules in a stylesheet, and the ones you are most likely to script.
In IE8 and before, CSSRule objects support only the
These are the possible values of the
typeproperty below and they specify what kind of rule it is. If
typeis anything other than 1, the CSSRule object will have other properties that are not documented here.
The complete text of this CSS rule.
The rule, if any, within which this rule is contained.
The stylesheet within which this rule is contained. ...