CSSStyleDeclaration : Object
CSSStyleDeclaration allows styling HTMLElements. The HTMLElement.style property contains the style rules directly set on the element. Use the
window.getComputedStyle()
method to get the computed style of an element.Instance Properties
backgroundImage : String
The image to place in the background of the element. See also backgroundPosition
, backgroundRepeat
, and backgroundSize
.
Example:
RunResults:
objectFit : String
Applies to <img>
and <video>
elements. Determines how the content of the element fits inside its CSS layout box. Similar to how backgroundSize
affects how the backgroundImage
. Must be one of 'fill'
, 'contain'
, 'cover'
, 'none'
, or 'scale-down'
. See also objectPosition
.
Example:
RunResults:
objectPosition : String
Applies to <img>
and <video>
elements. Specifies the X and Y positions of where the content of the element fits inside its CSS layout box. Similar to how backgroundPosition
affects how the backgroundImage
. See also objectFit
.
Example:
RunResults:
Copyright © JavaScripture Contributors