mozilla

Revision 85853 of CSSRuleList

  • Revision slug: DOM/CSSRuleList
  • Revision title: CSSRuleList
  • Revision id: 85853
  • Created:
  • Creator: Mgjbot
  • Is current revision? No
  • Comment robot Adding: [[pl:DOM:stylesheet.cssRules]]

Revision Content

{{template.DomRef()}}

Summary

Returns all of the CSS rules in the stylesheet as an array.

Syntax

rules = stylesheet.cssRules 

rules is an array of individual cssRule objects. The individual cssRule object can refer to one of the following objects:

Example

// get to the first rule 
first_rule = document.styleSheets[0].cssRules[0];

Notes

See DOM cssRule object.

Specification

DOM Level 2 Style: CSSStyleSheet.cssRule

{{ wiki.languages( { "pl": "pl/DOM/stylesheet.cssRules" } ) }}

Revision Source

<p>
{{template.DomRef()}}
</p>
<h3 name="Summary"> Summary </h3>
<p>Returns all of the CSS rules in the stylesheet as an array. 
</p>
<h3 name="Syntax"> Syntax </h3>
<pre class="eval"><i>rules</i> = stylesheet.cssRules 
</pre>
<p><code>rules</code> is an array of individual <code>cssRule</code> objects. The individual <code>cssRule</code> object can refer to one of the following objects:
</p>
<ul><li> <a href="en/DOM/cssRule#CSSStyleRule">CSSStyleRule</a>
</li><li> <a href="en/DOM/cssRule#CSSMediaRule">CSSMediaRule</a>
</li><li> <a href="en/DOM/cssRule#CSSFontFaceRule">CSSFontFaceRule</a>
</li><li> <a href="en/DOM/cssRule#CSSPageRule">CSSPageRule</a>
</li><li> <a href="en/DOM/cssRule#CSSImportRule">CSSImportRule</a>
</li><li> <a href="en/DOM/cssRule#CSSCharsetRule">CSSCharsetRule</a>
</li><li> <a href="en/DOM/cssRule#CSSUnknownRule">CSSUnknownRule</a>
</li></ul>
<h3 name="Example"> Example </h3>
<pre class="eval">// get to the first rule 
first_rule = document.styleSheets[0].cssRules[0];
</pre>
<h3 name="Notes"> Notes </h3>
<p>See DOM <a href="en/DOM/cssRule">cssRule</a> object.
</p>
<h3 name="Specification"> Specification </h3>
<p><a class="external" href="http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-cssRules">DOM Level 2 Style: CSSStyleSheet.cssRule</a>
</p>
<div class="noinclude">
</div>
{{ wiki.languages( { "pl": "pl/DOM/stylesheet.cssRules" } ) }}
Revert to this revision