CSSStyleRule

Você está lendo a versão em inglês deste conteúdo porque ainda não há uma tradução para este idioma. Ajude-nos a traduzir este artigo!

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

Properties

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

Specifications

Specification Status Comment
CSS Object Model (CSSOM)
The definition of 'CSSStyleRule' in that specification.
Working Draft No changes
Document Object Model (DOM) Level 2 Style Specification
The definition of 'CSSRule' in that specification.
Obsolete

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
CSSStyleRuleChrome Full support 1Edge Full support YesFirefox Full support 1IE Full support 9Opera Full support YesSafari Full support YesWebView Android Full support 4.4Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
selectorTextChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 9Opera Full support YesSafari Full support 6WebView Android Full support 4.4Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
styleChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 9Opera Full support YesSafari Full support 6WebView Android Full support 4.4Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
styleMapChrome Full support 65Edge ? Firefox ? IE ? Opera Full support YesSafari ? WebView Android Full support 65Chrome Android Full support 65Firefox Android ? Opera Android Full support YesSafari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown