Easy Tutorial
❮ Met Document Createdocumentfragment Met Canvas Createpattern ❯

CSS Style Declaration Object (CSSStyleDeclaration)

CSSStyleDeclaration Object

The CSSStyleDeclaration object represents a collection of CSS property-value pairs.


CSSStyleDeclaration Object Properties

Property Description
cssText Sets or returns the style declaration text, corresponding to the style attribute of an HTML element.
length Returns the number of declarations in the style.
parentRule Returns the rule that contains the current rule.

CSSStyleDeclaration Object Methods

Method Description
getPropertyPriority() Returns whether the specified CSS property has the "important!" priority set.
getPropertyValue() Returns the value of the specified CSS property.
item() Returns the CSS property name by index in the CSS declaration.
removeProperty() Removes a CSS property from the CSS declaration.
setProperty() Adds or modifies a CSS property in the CSS declaration block.
❮ Met Document Createdocumentfragment Met Canvas Createpattern ❯