DOM:cssRule
From MDC
The CSSRule object represents a single CSS style rule. It may be a part of a stylesheet's cssRules list.
There are several kinds of rules. All of them share a few common properties on the CSSRule interface and most of them have some properties specific to a particular rule type.
| Type | Rule-specific interface | Description |
|---|---|---|
CSSRule.STYLE_RULE | CSSStyleRule | |
CSSRule.MEDIA_RULE | CSSMediaRule | |
CSSRule.FONT_FACE_RULE | CSSFontFaceRule | |
CSSRule.PAGE_RULE | CSSPageRule | |
CSSRule.IMPORT_RULE | CSSImportRule | |
CSSRule.CHARSET_RULE | CSSCharsetRule | |
CSSRule.UNKNOWN_RULE | CSSUnknownRule |
Contents |
[edit] CSSRule
- cssText
- Returns the textual representation of the rule, e.g. "h1,h2 { font-size: 16pt }".
- parentRule
- Returns the containing rule, if any (e.g. a style rule inside an @media block).
- parentStyleSheet
- Returns the stylesheet object that this rule is part of.
- type
- The type of the rule, e.g.
CSSRule.CHARSET_RULEorCSSRule.IMPORT_RULE.
[edit] CSSStyleRule
- selectorText
- Gets/sets the textual representation of the selector for this rule, e.g. "h1,h2".
- style
- Returns the CSSStyleDeclaration object for the declaration block of the rule.