CSSSupportsRule

CSSSupportsRule interface describes an object representing a single CSS @supports at-rule . It implements the CSSConditionRule interface, and therefore the CSSRule and CSSGroupingRule interfaces with a type value of 12 ( CSSRule.SUPPORTS_RULE ).

句法

The syntax is described using the WebIDL format.

interface CSSSupportsRule : CSSConditionRule {
}
					

特性

As a CSSConditionRule and therefore a CSSRule CSSGroupingRule , CSSSupportsRule also implements the properties of these interfaces. It has no specific properties.

方法

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

规范

规范 状态 Comment
CSS Conditional Rules Module Level 3
The definition of 'CSSSupportsRule' in that specification.
候选推荐 初始定义

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
CSSSupportsRule Chrome No Edge ≤18 — 79 Firefox 17
Disabled
17
Disabled
From Firefox 17 to 19, methods and properties were defined on CSSSupportsRule . From version 20, they were on CSSConditionRule .
Disabled From version 17: this feature is behind the layout.css.supports-rule.enable preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE No Opera 12.1 Safari No WebView Android No Chrome Android No Firefox Android 17
Disabled
17
Disabled
From Firefox 17 to 19, methods and properties were defined on CSSSupportsRule . From version 20, they were on CSSConditionRule .
Disabled From version 17: this feature is behind the layout.css.supports-rule.enable preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android No Safari iOS No Samsung Internet Android No

图例

完整支持
完整支持
不支持
不支持
见实现注意事项。
用户必须明确启用此特征。
用户必须明确启用此特征。

另请参阅