public interface CSSRule
An object implementing the CSSRule
DOM interface represents a single CSS rule. References to a CSSRule
-implementing object may be obtained by looking at a CSS style sheet's cssRules
list.
There are several kinds of rules. The CSSRule
interface specifies the properties common to all rules, while properties unique to specific rule types are specified in the more specialized interfaces for those rules' respective types.
Modifier and Type | Field and Description |
---|---|
static int |
CHARSET_RULE |
static int |
FONT_FACE_RULE |
static int |
IMPORT_RULE |
static int |
MEDIA_RULE |
static int |
PAGE_RULE |
static int |
STYLE_RULE |
static int |
UNKNOWN_RULE |
static int |
WEBKIT_KEYFRAME_RULE |
static int |
WEBKIT_KEYFRAMES_RULE |
Modifier and Type | Method and Description |
---|---|
String |
getCssText()
Returns the textual representation of the rule, e.g.
|
CSSRule |
getParentRule()
Returns the containing rule, otherwise
null . |
CSSStyleSheet |
getParentStyleSheet()
Returns the
CSSStyleSheet object for the style sheet that contains this rule |
int |
getType()
One of the Type constants indicating the type of CSS rule.
|
void |
setCssText(String arg) |
static final int CHARSET_RULE
static final int FONT_FACE_RULE
static final int IMPORT_RULE
static final int MEDIA_RULE
static final int PAGE_RULE
static final int STYLE_RULE
static final int UNKNOWN_RULE
static final int WEBKIT_KEYFRAMES_RULE
static final int WEBKIT_KEYFRAME_RULE
String getCssText()
"h1,h2 { font-size: 16pt }"
void setCssText(String arg)
CSSRule getParentRule()
null
. E.g. if this rule is a style rule inside an @media
block, the parent rule would be that CSSMediaRule
.CSSStyleSheet getParentStyleSheet()
CSSStyleSheet
object for the style sheet that contains this ruleint getType()
Copyright © 2018. All rights reserved.