CSSMediaRule : CSSRule

Represents a media rule in a CSS style sheet.

Browser/User Agent Support

IEMozillaNetscapeOperaSafariNetscapte
no1.0+no9.0+1.0+no

Constructors

ConstructorIEMozillaNetscapeOperaSafariNetscapte
Represents a media rule in a CSS style sheet.
no1.0+no9.0+1.0+no
 

Properties

PropertyIEMozillaNetscapeOperaSafariNetscapte
Array of all rules nested within the rule block.
no1.0+no9.0+1.0+no
 
Array of media types that the nested rules apply to.
no1.0+no9.0+1.0+no
 

Methods

MethodIEMozillaNetscapeOperaSafariNetscapte
Deletes the specified rule from the CSSRules array.
no1.0+no9.0+nono
 
Inserts the specified rule into the CSSRules array at the specified position.
no1.0+no9.0+nono
 

Availability

HTML DOM Level 2 | W3C

Constructor Detail

CSSMediaRule CSSMediaRule()

Represents a media rule in a CSS style sheet.

Visibility
internal

Property Detail

CSSRuleList cssRules - read only

Array of all rules nested within the rule block.

For examples, see the quirksmode test page:

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

Availability

HTML DOM Level 2 | W3C

MediaList media - read only

Array of media types that the nested rules apply to.

Availability

HTML DOM Level 2 | W3C

Method Detail

deleteRule(Number index) : void

Deletes the specified rule from the CSSRules array.

NumberindexPosition in the CSSRules array where the rule to be deleted is located.

For examples, see the quirksmode test page:

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

See Also

CSSMediaRule.insertRule

Availability

HTML DOM Level 2 | W3C

insertRule(String rule, Number index) : Object

Inserts the specified rule into the CSSRules array at the specified position.

StringruleRule to insert.
NumberindexPosition to insert the rule in the CSSRules array.

For examples, see the quirksmode test page:

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

See Also

CSSMediaRule.deleteRule

Availability

HTML DOM Level 2 | W3C