We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

这篇翻译不完整。请帮忙从英语翻译这篇文章

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

Syntax

The syntax is described using the WebIDL format.

interface CSSStyleRule : CSSRule {
    attribute DOMString selectorText;
    readonly attribute CSSStyleDeclaration style;
};

Properties

CSSStyleRule.selectorText
Gets the textual representation of the selector for this rule, e.g. "h1,h2".
CSSStyleRule.style 只读
Returns the CSSStyleDeclaration object for the rule. Read only.

Specification

Specification Status Comment
CSS Object Model (CSSOM)
CSSStyleRule
Working Draft No changes
Document Object Model (DOM) Level 2 Style Specification
CSSRule
Obsolete  

Browser compatibility

To get browser compatibility information about the different type constant value, please consult the compatibility table of the associated interface.

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (Yes) (Yes) (Yes) (Yes) (Yes)
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support (Yes) (Yes) (Yes) (Yes) (Yes)

文档标签和贡献者

此页面的贡献者: fscholz, teoli, ziyunfei
最后编辑者: fscholz,