Interface CSSStyleDeclarationBase
cssText: string;
length: number;
parentRule: CSSRule | null;
getPropertyPriority(property: string): string;
getPropertyValue(property: string): string;
item(index: number): string;
removeProperty(property: string): string;
setProperty(
property: string,
value: string | null,
priority?: string,
): void;
[index: number]: string;
}
Hierarchy (View Summary)
- CSSStyleDeclarationBase
Indexable
-
[index: number]: string
Properties
cssText
The cssText property of the CSSStyleDeclaration interface returns or sets the text of the element's inline style declaration only.
Readonlylength
The read-only property returns an integer that represents the number of style declarations in this CSS declaration block.
ReadonlyparentRule
The CSSStyleDeclaration.parentRule read-only property returns a CSSRule that is the parent of this style block, e.g., a CSSStyleRule representing the style for a CSS selector.
Methods
getPropertyPriority
-
The
CSSStyleDeclaration.getPropertyPriority()method interface returns a string that provides all explicitly set priorities on the CSS property.Parameters
- property: string
Returns string
getPropertyValue
-
The
CSSStyleDeclaration.getPropertyValue()method interface returns a string containing the value of a specified CSS property.Parameters
- property: string
Returns string
item
-
The
CSSStyleDeclaration.item()method interface returns a CSS property name from a CSSStyleDeclaration by index.Parameters
- index: number
Returns string
removeProperty
-
The
CSSStyleDeclaration.removeProperty()method interface removes a property from a CSS style declaration object.Parameters
- property: string
Returns string
setProperty
-
The
CSSStyleDeclaration.setProperty()method interface sets a new value for a property on a CSS style declaration object.Parameters
- property: string
- value: string | null
Optionalpriority: string
Returns void
The
CSSStyleDeclarationinterface is the base class for objects that represent CSS declaration blocks with different supported sets of CSS style information:MDN Reference