CSSMediaRule
interface represents a single CSS
@media
rule. It implements the
CSSConditionRule
interface, and therefore the
CSSGroupingRule
和
CSSRule
interface with a type value of
4
(
CSSRule.MEDIA_RULE
).
The syntax is described using the WebIDL 格式。
interface CSSMediaRule : CSSConditionRule {
readonly attribute MediaList media;
}
由于
CSSConditionRule
, and therefore both a
CSSGroupingRule
和
CSSRule
,
CSSMediaRule
also implements the properties of these interfaces. It has the following specific property:
CSSMediaRule.media
只读
MediaList
representing the intended destination medium for style information.
由于
CSSConditionRule
, and therefore both a
CSSGroupingRule
和
CSSRule
,
CSSMediaRule
also implements the methods of that interface. It has no specific methods.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
CSSMediaRule
|
Chrome 45 | Edge ≤18 |
Firefox
17
|
IE ? | Opera Yes | Safari Yes | WebView Android 45 | Chrome Android 45 |
Firefox Android
17
|
Opera Android Yes | Safari iOS Yes | Samsung Internet Android 5.0 |
media
|
Chrome Yes | Edge 12 | Firefox Yes | IE ? | Opera Yes | Safari Yes | WebView Android Yes | Chrome Android Yes | Firefox Android Yes | Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
完整支持
兼容性未知
见实现注意事项。
CSSMediaRule
AnimationEvent
CSS
CSSConditionRule
CSSGroupingRule
CSSKeyframeRule
CSSKeyframesRule
CSSNamespaceRule
CSSPageRule
CSSRule
CSSRuleList
CSSStyleDeclaration
CSSStyleRule
CSSStyleSheet
CSSSupportsRule
CaretPosition
LinkStyle
MediaQueryList
MediaQueryListListener
Screen
StyleSheet
StyleSheetList
TransitionEvent