CSSStyleSheet : StyleSheet

CSS style sheet.

Browser/User Agent Support

IEMozillaNetscapeOperaSafariNetscapte
6.0+1.0+no9.0+1.0+no

Constructors

ConstructorIEMozillaNetscapeOperaSafariNetscapte
CSS style sheet.
6.0+1.0+no9.0+1.0+no
 

Properties

PropertyIEMozillaNetscapeOperaSafariNetscapte
Array of CSSRule objects in the style sheet.
no1.0+no9.0+1.0+no
 
Specifies the CSSImportRule object for imported style sheets. Specifies null if the style sheet is not imported.
6.0+1.0+no9.0+1.0+no
 

Methods

MethodIEMozillaNetscapeOperaSafariNetscapte
Deletes a CSS rule at the specified position in the CSSRules array.
no1.0+no9.0+nono
 
Inserts the specified rule into the style sheet at the specified position.
no1.0+no9.0+nono
 

References

StyleSheet

Availability

HTML DOM Level 2 | W3C

Constructor Detail

CSSStyleSheet CSSStyleSheet()

CSS style sheet.

Visibility
internal

Property Detail

CSSRuleList cssRules - read only

Array of CSSRule objects in the style sheet.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/stylesheets.html

Availability

HTML DOM Level 2 | W3C

CSSRule ownerRule - read only

Specifies the CSSImportRule object for imported style sheets. Specifies null if the style sheet is not imported.

Availability

HTML DOM Level 2 | W3C

Method Detail

deleteRule(Number index) : void

Deletes a CSS rule at the specified position in the CSSRules array.

NumberindexPosition of the rule in the CSSRules array.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/stylesheet_change.html

See Also

CSSStyleSheet.insertRule

Availability

HTML DOM Level 2 | W3C

insertRule(String rule, Number index) : Object

Inserts the specified rule into the style sheet at the specified position.

StringruleComplete text for the CSS rule to be inserted.
NumberindexPosition in the CSSRules array where the rule is to be inserted.

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/stylesheet_change.html

See Also

CSSStyleSheet.deleteRule

Availability

HTML DOM Level 2 | W3C