Table of Contents

Class CSSStyleRule

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The CSSStyleRule interface represents a single CSS style rule.

[Value("CSSStyleRule")]
public class CSSStyleRule : CSSGroupingRule
Inheritance
CSSStyleRule
Inherited Members

Remarks

Constructors

CSSStyleRule()

public CSSStyleRule()

Properties

SelectorText

The selectorText property of the CSSStyleRule interface gets and sets the selectors associated with the CSSStyleRule.

[Value("selectorText")]
public string SelectorText { get; set; }

Property Value

string

A string.

Remarks

Style

The read-only style property of the CSSStyleRule interface contains a CSSStyleProperties object representing the properties list in this style rule's body.

[Value("style")]
public CSSStyleProperties Style { get; }

Property Value

CSSStyleProperties

A CSSStyleProperties object.

NOTE
Earlier versions of the specification returned a CSSStyleDeclaration, which is now the base class of CSSStyleProperties.
See the browser compatibility table for browser support information.
Although the style property itself is read-only in the sense that you can't replace the CSSStyleProperties object, you can still assign to the style property directly, which is equivalent to assigning to its CSSStyleDeclarationcssText property. You can also modify the CSSStyleProperties object using the CSSStyleDeclarationsetProperty and CSSStyleDeclarationremoveProperty methods.

Remarks

Each CSS property supported by the browser is present on the object.
The properties that are not defined inline in the corresponding CSS declaration are set to the empty string ("").

See also on MDN

StyleMap

The styleMap read-only property of the
CSSStyleRule interface returns a 'StylePropertyMap' object
which provides access to the rule's property-value pairs.

[Value("styleMap")]
public StylePropertyMap StyleMap { get; }

Property Value

StylePropertyMap

A 'StylePropertyMap' object.

Remarks