Package | dom.style.css |
Class | public class CSSStyleRule |
Inheritance | CSSStyleRule CSSRule Object |
Introduced in: | DOM 2 Core |
See also
Property | Defined By | ||
---|---|---|---|
DOM 2 Style cssText : DOMString [read-only]
The parsable textual representation of the rule. | CSSRule | ||
DOM 2 Style parentRule : CSSRule [read-only]
If this rule is contained inside another rule (e.g. | CSSRule | ||
DOM 2 Style parentStyleSheet : CSSStyleSheet [read-only]
The style sheet that contains this rule. | CSSRule | ||
Non-Standard readOnly : Boolean [read-only]
Retrieves whether the rule or style sheet is defined on the page or is imported. | CSSStyleRule | ||
DOM 2 Style selectorText : DOMString [read-only]
The textual representation of the selector for the rule set. | CSSStyleRule | ||
DOM 2 Style style : CSSStyleDeclaration [read-only]
The declaration-block of this rule set. | CSSStyleRule | ||
DOM 2 Style type : Number [read-only]
The type of the rule, as defined above. | CSSRule |
readOnly | property |
readOnly:Boolean
[read-only] Non-standard (Microsoft)
Retrieves whether the rule or style sheet is defined on the page or is imported.
Note (IE): You cannot modify style sheets obtained through a link object or the @import rule while the designMode property is enabled.
The default value is false. Rule or style sheet is obtained through a link object or the @import rule.
.
public function get readOnly():Boolean
See also
DOM 2 Style selectorText | property |
selectorText:DOMString
[read-only] Introduced in: | DOM 2 Core |
The textual representation of the selector for the rule set.
Note: The implementation may have stripped out insignificant whitespace while parsing the selector.
public function get selectorText():DOMString
DOMException — SYNTAX_ERR: Raised if the specified CSS string value
has a syntax error and is unparsable.
| |
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if this rule
is readonly.
|
See also
// for cssrule: body { background-color: darkblue; } cssrule = document.styleSheets[1]; !!TODO!! selector = cssrule.selectorText; // selector is now "body"
DOM 2 Style style | property |
style:CSSStyleDeclaration
[read-only] Introduced in: | DOM 2 Core |
The declaration-block of this rule set.
Note: The declaration block is that part of the style rule that appears within the braces and that actually provides the style definitions (for the selector, the part that comes before the braces).
public function get style():CSSStyleDeclaration
See also
function stilo() { alert(document.styleSheets[0].cssRules[0].style.cssText); } // displays "background-color: gray;"