Style transformOrigin property
Example
Set the base point position of a rotated element:
document.getElementById("myDIV").style.transformOrigin="0 0";
Try it »
Definition and Usage
The transformOrigin property allows you to change the position of a transformed element.
A 2D transformed element can change the X and Y axes of an element. A 3D transformed element can also change the Z axis of an element.
**Note:** This property must be used with transform property.
Browser support

Internet Explorer 10, Firefox and Opera support the transformOrigin property.
Internet Explorer 9 supports another property that can replace this property, namely the msTransformOrigin property (used only for 2D transformations).
Chrome, Safari and Opera support another property that can replace this property, namely the WebkitTransformOrigin property (available for both 3D and 2D transformations).
Syntax
Return the transformOrigin property:
object
.style.transformOrigin
Set the transformOrigin property:
object
.style.transformOrigin="
x-axis y-axis z-axis
|initial|inherit"
Attribute values
| Value | Description |
|---|---|
| x-axis | Defines where the view is placed on the X-axis. Possible values:
|
- top
- center
- bottom
- length
- %
- length
Technical Details
| Default value: | 50% 50% 0 |
|---|---|
| Return Value: | A string, representing the transform-origin property of an element. |
| CSS version | CSS3 |
Related Articles
JavaScript Style object:transform property
CSS Reference Manual:transform-origin property
The Style object