过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

rules 弃用 legacy property CSSStyleSheet interface. Functionally identical to the preferred cssRules property, it provides access to a live-updating list of the CSS rules comprising the stylesheet.

注意: As a legacy property, you not use rules and should instead use the preferred cssRules . While rules is unlikely to be removed soon, its availability is not as widespread and using it will result in compatibility problems for your site or app.

句法

var rules = cssStyleSheet.rules;
					

A live-updating CSSRuleList containing each of the CSS rules making up the stylesheet. Each entry in the rule list is a CSSRule object describing one rule making up the stylesheet.

规范

规范 状态 注释
CSS Object Model (CSSOM)
The definition of 'CSSStyleSheet.rules' in that specification.
工作草案

浏览器兼容性

The compatibility table on 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. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
rules 弃用 Chrome Yes Edge 12 Firefox 68 IE 9 Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 68 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes

图例

完整支持

完整支持

弃用。不要用于新网站。

弃用。不要用于新网站。

另请参阅

元数据

  • 最后修改: