MDN wants to talk to developers like you:


Esta traducción está incompleta. Por favor, ayuda a traducir este artículo del inglés.

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


The syntax is described using the WebIDL format.

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


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


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.

Browser compatibility

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

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)

Etiquetas y colaboradores del documento

 Colaboradores en esta página: fscholz
 Última actualización por: fscholz,