CSSRule

  • Revision slug: DOM/cssRule
  • Revision title: CSSRule
  • Revision id: 85893
  • Created:
  • Creator: Dria
  • Is current revision? No
  • Comment

Revision Content

{{template.DomRef()}}

DOM cssRule Object

The cssRule object represents a single CSS style rule. These rules may be a part of a stylesheet or they may be placed in-line with the individual nodes in the HTML or XML document. Each stylesheet object exposes an array of the cssRules that make it up, and you can also get to the rules on individual elements by using the element.style property.

Properties

cssRule.cssText 
cssText returns the actual text of the style rule.
cssRule.parentStyleSheet 
parentStyleSheet returns the stylesheet object in which the current rule is defined.
cssRule.selectorText 
selectorText gets/sets the textual representation of the selector for the rule set.
cssRule.style 
style returns the declaration block for the current style.

Revision Source

<p>
{{template.DomRef()}}
</p>
<h3 name="DOM_cssRule_Object">DOM cssRule Object</h3>
<p>The cssRule object represents a single CSS style rule. These rules may be a part of a stylesheet or they may be placed in-line with the individual nodes in the HTML or XML document. Each stylesheet object exposes an array of the cssRules that make it up, and you can also get to the rules on individual elements by using the element.style property.
</p>
<h4 name="Properties">Properties</h4>
<dl><dt> <a href="en/DOM/cssRule.cssText">cssRule.cssText</a> </dt><dd> cssText returns the actual text of the style rule.
</dd><dt> <a href="en/DOM/cssRule.parentStyleSheet">cssRule.parentStyleSheet</a> </dt><dd> parentStyleSheet returns the stylesheet object in which the current rule is defined.
</dd><dt> <a href="en/DOM/cssRule.selectorText">cssRule.selectorText</a> </dt><dd> selectorText gets/sets the textual representation of the selector for the rule set.
</dd><dt> <a href="en/DOM/cssRule.style">cssRule.style</a> </dt><dd> style returns the declaration block for the current style.
</dd></dl>
Revert to this revision