Style backgroundPosition Property
Style backgroundPosition Property
The backgroundPosition property is used to either set or return the position of a background image within an element.
Syntax:-
Its syntax is:- object.style.backgroundPosition OR object.style.backgroundPosition = value
Return:-
Its return is:- string having the position of a background-image
Further Explanation:-
Value | Description |
---|---|
top left bottom left |
If only one keyword is specified then other value will be center. |
x% y% | The x value indicates the horizontal position and the y value indicates the vertical position. |
xpos ypos | The x value indicates the horizontal position and the y value indicates the vertical position. |
initial | Sets property to its default value. |
inherit | Inherits property from its parent element. |