CSSMediaRule

CSSMediaRule 인터페이스는 하나의 CSS @media 규칙을 나타냅니다. CSSConditionRule 인터페이스를 구현하므로, CSSGroupingRuleCSSRule 인터페이스도 유형값 4 (CSSRule.MEDIA_RULE)로 구현합니다.

구문

WebIDL 형식을 사용해 서술합니다.

interface CSSMediaRule : CSSConditionRule {
    readonly attribute MediaList media;
}

속성

CSSMediaRuleCSSConditionRule, 그리고 CSSGroupingRuleCSSRule로서 해당 인터페이스의 속성을 구현합니다. 다음과 같은 자체 속성을 가집니다.

CSSMediaRule.media Read only
스타일 정보를 적용할 매체 정보를 나타내는 MediaList입니다.

메서드

CSSMediaRuleCSSConditionRule, 그리고 CSSGroupingRuleCSSRule로서 해당 인터페이스의 메서드를 구현합니다. 자체 메서드는 가지지 않습니다.

명세

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  

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox 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 45Firefox 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 YesFirefox 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.