Nos bénévoles n'ont pas encore traduit cet article en Français. Inscrivez-vous et aidez-nous à réaliser cette tâche !
Vous pouvez également lire cet article en English (US).

The CSSMediaRule interface represents a single CSS @media rule. It implements the CSSConditionRule interface, and therefore the CSSGroupingRule and the CSSRule interface with a type value of 4 (CSSRule.MEDIA_RULE).

Syntax

The syntax is described using the WebIDL format.

interface CSSMediaRule : CSSConditionRule {
    readonly attribute MediaList media;
}

Properties

As a CSSConditionRule, and therefore both a CSSGroupingRule and a CSSRule, CSSMediaRule also implements the properties of these interfaces. It has the following specific property:

CSSMediaRule.media Read only
Specifies a MediaList representing the intended destination medium for style information.

Methods

As a CSSConditionRule, and therefore both a CSSGroupingRule and a CSSRule, CSSMediaRule also implements the methods of that interface. It has no specific methods.

Specifications

Specification Status Comment
CSS Conditional Rules Module Level 3
The definition of 'CSSMediaRule' in that specification.
Candidate Recommendation Make it derived from the CSSConditionRule.
CSS Object Model (CSSOM)
The definition of 'CSSMediaRule' in that specification.
Working Draft No changes from Document Object Model (DOM) Level 2 Style Specification
Document Object Model (DOM) Level 2 Style Specification
The definition of 'CSSMediaRule' in that specification.
Obsolete  

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
CSSMediaRuleChrome Full support 45Edge Full support YesFirefox Full support 17
Notes
Full support 17
Notes
Notes Before Firefox 20, conditionText could not be set.
IE ? Opera Full support YesSafari Full support YesWebView Android Full support 45Chrome Android Full support 45Edge Mobile Full support YesFirefox Android Full support 17
Notes
Full support 17
Notes
Notes Before Firefox 20, conditionText could not be set.
Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
mediaChrome Full support YesEdge Full support 12Firefox Full support YesIE ? Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile ? Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.

Étiquettes et contributeurs liés au document

Étiquettes : 
Dernière mise à jour par : alattalatta,