CSSStyleRule

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2015.

* Some parts of this feature may have varying levels of support.

CSSStyleRule representa una sola regla de estilos CSS. Implementa la interfaz CSSRule with a type value of 1 (CSSRule.STYLE_RULE).

Sintaxis

La sintaxis es descrita usando el formato WebIDL.

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

Propiedades

CSSStyleRule.selectorText

Obtiene la representación textual del selector para esta regla, e.g. "h1,h2".

CSSStyleRule.style Read only

Retorna el objeto CSSStyleDeclaration para la regla. Sólo lectura.

Especificaciones

Specification
CSS Object Model (CSSOM)
# the-cssstylerule-interface

Compatibilidad con navegadores

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
CSSStyleRule
cssRules
deleteRule
insertRule
selectorText
style
styleMap

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.