CSSStyleRule

CSSStyleRule represents a single CSS style rule. It implements the CSSRule interface with a type value of 1 ( CSSRule.STYLE_RULE ).

特性

CSSStyleRule.selectorText
Returns the textual representation of the selector for this rule, e.g. "h1,h2" .
CSSStyleRule.style 只读
返回 CSSStyleDeclaration object for the rule.
CSSStyleRule.styleMap 只读
返回 StylePropertyMap object which provides access to the rule's property-value pairs.

规范

规范 状态 Comment
CSS Object Model (CSSOM)
The definition of 'CSSStyleRule' in that specification.
工作草案 No changes
Document Object Model (DOM) Level 2 Style Specification
The definition of 'CSSRule' in that specification.
Obsolete

浏览器兼容性

更新 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
CSSStyleRule Chrome 1 Edge 12 Firefox 1 IE 9 Opera Yes Safari Yes WebView Android 4.4 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
selectorText Chrome 1 Edge 12 Firefox 1 IE 9 Opera Yes Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
style Chrome 1 Edge 12 Firefox 1 IE 9 Opera Yes Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
styleMap Chrome 65 Edge ≤79 Firefox ? IE ? Opera Yes Safari ? WebView Android 65 Chrome Android 65 Firefox Android ? Opera Android Yes Safari iOS ? Samsung Internet Android 9.0

图例

完整支持
完整支持
兼容性未知
兼容性未知