Table of Contents

Class HTMLStyleElement

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The HTMLStyleElement interface represents a {{HTMLElement("style")}} element. It inherits properties and methods from its parent, HTMLElement.

[Value("HTMLStyleElement")]
public class HTMLStyleElement : HTMLElement, Region, GeometryUtils, ParentNode, NonDocumentTypeChildNode, ChildNode, Slottable, ARIAMixin, Animatable, ElementCSSInlineStyle, GlobalEventHandlers, ElementContentEditable, HTMLOrSVGElement, LinkStyle
Inheritance
HTMLStyleElement
Implements
Inherited Members

Remarks

This interface doesn't allow to manipulate the CSS it contains (in most case). To manipulate CSS, see Using dynamic styling information for an overview of the objects used to manipulate specified CSS properties using the DOM.

-The HTML element implementing this interface: style.
-Using dynamic styling information to see how to manipulate CSS.

See also on MDN

Constructors

HTMLStyleElement()

public HTMLStyleElement()

Properties

Blocking

The read-only blocking property of the HTMLStyleElement returns a live DOMTokenList object containing the operations that should be blocked on the fetching of an external resource. It reflects the {{HTMLElement("style")}} element's blocking content attribute.

[Value("blocking")]
public DOMTokenList Blocking { get; }

Property Value

DOMTokenList

A live DOMTokenList object.Although the blocking property itself is read-only in the sense that you can't replace the DOMTokenList object, you can still assign to the blocking property directly, which is equivalent to assigning to its DOMTokenListvalue property. You can also modify the DOMTokenList object using the DOMTokenListadd, DOMTokenListremove, DOMTokenListreplace, and DOMTokenListtoggle methods.

Remarks

Disabled

The HTMLStyleElement.disabled property can be used to get and set whether the stylesheet is disabled (true) or not (false).

[Value("disabled")]
public bool Disabled { get; set; }

Property Value

bool

Returns true if the stylesheet is disabled, or there is no associated stylesheet; otherwise false.
The value is false by default (if there is an associated stylesheet).The property can be used to enable or disable an associated stylesheet.
Setting the property to true when there is no associated stylesheet has no effect.

Remarks

Note that there is no corresponding disabled attribute on the HTML <style> element.

-SVGStyleElement.Disabled

See also on MDN

Media

The HTMLStyleElement.media property specifies the
intended destination medium for style information.

[Value("media")]
public string Media { get; set; }

Property Value

string

A string describing a single medium or a comma-separated list.

Remarks

Type

IMPORTANT
Deprecated
The HTMLStyleElement.type property returns the type of the current style.
The value mirrors the HTML <style> element's type attribute.
[Value("type")]
public string Type { get; set; }

Property Value

string

The permitted values are an empty string or a case-insensitive match for "text/css".

Remarks

Authors should not use this property or rely on the value.

-Type

See also on MDN