The CSSStyleSheet interface represents a single CSS style sheet. It inherits properties and methods from its parent, StyleSheet.

Documentation CSSStyleSheet by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:


read onlycssRules:CSSRuleList

Returns a live CSSRuleList, listing the CSSRule objects in the style sheet.

This is normally used to access individual rules like this:

   styleSheet.cssRules[i] // where i = 0..cssRules.length-1

To add or remove items in cssRules, use the CSSStyleSheet's deleteRule() and insertRule() methods, described below.

read onlyownerRule:CSSRule

If this style sheet is imported into the document using an @import rule, the ownerRule property will return that CSSImportRule, otherwise it returns null.



Deletes a rule at the specified position from the style sheet.




@:value({ index : 0 })insertRule(rule:String, index:Int = 0):Int

Inserts a new rule at the specified position in the style sheet, given the textual representation of the rule.




Inherited Variables

Defined by StyleSheet


Is a Boolean representing whether the current stylesheet has been applied or not.

read onlyhref:String

Returns a DOMString representing the location of the stylesheet.

read onlymedia:MediaList

Returns a MediaList representing the intended destination medium for style information.

read onlyownerNode:Node

Returns a Node associating this style sheet with the current document.

read onlyparentStyleSheet:StyleSheet

Returns a StyleSheet including this one, if any; returns null if there aren't any.

read onlytitle:String

Returns a DOMString representing the advisory title of the current style sheet.

read onlytype:String

Returns a DOMString representing the style sheet language for this style sheet.

Inherited Methods