CSSStyleRule
表示一条 CSS 样式规则。它实现了 CSSRule
接口,类型的值为 1
(CSSRule.STYLE_RULE
)。
属性
CSSStyleRule.selectorText
- 返回这条规则的、文本格式的选择器,例如
"h1,h2"
。 CSSStyleRule.style
只读- 返回这条规则的
CSSStyleDeclaration
对象。 CSSStyleRule.styleMap
只读- 返回一个
StylePropertyMap
对象,which provides access to the rule's property-value pairs.
规范
规范 | 状态 | 备注 |
---|---|---|
CSS Object Model (CSSOM) CSSStyleRule |
Working Draft | No changes |
Document Object Model (DOM) Level 2 Style Specification CSSRule |
Obsolete |
浏览器兼容性
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.