Style transformOrigin Property
Style transformOrigin Property
The transformOrigin property is used to change the position of transformed elements. For a 2D transformed element, we can change both the x-axis and y-axis of the element. For the 3D transformed element, we can change all three axes i.e, x-axis, y-axis, and z-axis.
Syntax:-
Its syntax is:- object.style.transformOrigin OR object.style.transformOrigin = x-axis y-axis z-axis | initial | inherit
Return:-
Its return is:- string having transform-origin property of an element
Further Explanation:-
Value | Description |
---|---|
x-axis | Defining where the view is placed at the x-axis like left, right, center or length in px or %. |
y-axis | Defining where the view is placed at the y-axis like top, bottom, center or length in px or %. |
z-axis | Defining where the view is placed at the z-axis. |
initial | Sets property to its default value. |
inherit | Inherits property from its parent element. |