CSSStyleDeclaration class
The interface represents an object that is a CSS declaration block, and exposes style information and various style-related methods and properties. A object can be exposed using three different APIs:
Via HTMLElement.style
, which deals with the inline styles of
a single element (e.g., <div style="...">
).
Via the CSSStyleSheet API. For example,
[document.styleSheets0
.cssRules0
.style] returns a object on
the first CSS rule in the document's first stylesheet.
Via Window.getComputedStyle()
, which exposes the object as a
read-only interface.
- Available extensions
- Annotations
-
- @JS()
- @staticInterop
Constructors
- CSSStyleDeclaration()
-
factory
Properties
- cssFloat ↔ String
-
Available on CSSStyleDeclaration, provided by the PropsCSSStyleDeclaration extension
getter/setter pair - cssText ↔ String
-
Available on CSSStyleDeclaration, provided by the PropsCSSStyleDeclaration extension
getter/setter pair - hashCode → int
-
The hash code for this object.
no setterinherited
- length → int
-
Available on CSSStyleDeclaration, provided by the PropsCSSStyleDeclaration extension
no setter - parentRule → CSSRule?
-
Available on CSSStyleDeclaration, provided by the PropsCSSStyleDeclaration extension
no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getPropertyPriority(
String property) → String -
Available on CSSStyleDeclaration, provided by the PropsCSSStyleDeclaration extension
-
getPropertyValue(
String property) → String -
Available on CSSStyleDeclaration, provided by the PropsCSSStyleDeclaration extension
-
item(
int index) → String -
Available on CSSStyleDeclaration, provided by the PropsCSSStyleDeclaration extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeProperty(
String property) → String -
Available on CSSStyleDeclaration, provided by the PropsCSSStyleDeclaration extension
-
setProperty(
String property, String value, [String? priority = '']) → void -
Available on CSSStyleDeclaration, provided by the PropsCSSStyleDeclaration extension
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited