XML DOM CSSRule Object
- Previous page DOM CSS2Properties
- Next page DOM CSSStyleRule
CSSRule-object
Het CSSRule-object is een basisklasse, gebruikt om elke regel in een CSS-stijltafel te definiëren, inclusief regelsets (rule sets) en @-regels (at-rules).
Er bestaan verschillende soorten regels. Deze soorten delen niet veel algemene eigenschappen in het CSSRule-interface, de meeste soorten hebben specifieke eigenschappen voor de betreffende regeltype.
Type van CSS-regels
Type | Corresponding interfaces |
---|---|
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 |
CSSRule object properties
- cssText
- Returns the text representation of the rule, for example "h1,h2 { font-size: 16pt }".
- parentRule
- Returns the rule containing the rule (if any) (for example, in a @media block style rule).
- parentStyleSheet
- Returns the stylesheet object to which the rule belongs.
- type
- Rule type, for example CSSRule.CHARSET_RULE or CSSRule.IMPORT_RULE.
Note:All of the above properties are read-only.
Related pages
XML DOM reference manual:CSSStyleRule object
- Previous page DOM CSS2Properties
- Next page DOM CSSStyleRule