CSS transform-origin Property
Description
The transform-origin property defines the pivot point used when an element is transformed — in other words, it selects the origin about which transformations such as rotation, scaling and skewing are performed. Changing this origin does not itself reposition the element in normal document flow; instead it alters how subsequent transforms applied to the element take effect, often producing very different visual results even when the same transform is used. Because it changes the center of action for geometric operations, it is especially important when you need precise control over rotation arcs, scale anchors, or the apparent point of expansion and contraction.
The origin is resolved relative to the element’s geometric box, and which box is used can alter the result for elements like SVG or replaced elements; that relationship is influenced by the transform-box setting. The transform you apply will use that origin as its reference point, and in three-dimensional contexts the origin can include a depth component along the Z axis, changing the perceived spatial behavior of rotations and translations. When a 3D perspective is present, the visual effect of moving the origin interacts with the scene’s depth; the perspective you apply to the parent or containing block will therefore change how dramatic those shifts appear.
Because the origin determines the geometry of transform operations, animating it can create motion that appears to pivot around a changing point — rotations can sweep differently and scales can look like they grow from evolving anchors. You can animate changes to the origin itself so that the pivot moves smoothly while other transforms run; this is commonly coordinated with the transition or animation timing of the transform to produce natural-looking motion. Keep in mind that transforms and their origins are handled by the compositor rather than the layout engine, so altering the origin or transforms typically avoids reflow but can affect painting and stacking in complex scenes.
Definition
- Initial value
- 50% 50%
- Applies to
- Transformable elements
- Inherited
- No
- Computed value
- For <length> the absolute value, otherwise a percentage
- Animatable
- Yes
- JavaScript syntax
- object.style.transformOrigin
Interactive Demo
Syntax
transform-origin: [ left | center | right | top | bottom | <percentage> | <length> ] | [ left | center | right | <percentage> | <length> ] [ top | center | bottom | <percentage> | <length> ] <length>? | [ center | [ left | right ] ] && [ center | [ top | bottom ] ] <length>?
Values
- <percentage>A percentage for the horizontal offset is relative to the width of the bounding box. A percentage for the vertical offset is relative to height of the bounding box. The value for the horizontal and vertical offset represent an offset from the top left corner of the bounding box.
- <length>A length value gives a fixed length as the offset. The value for the horizontal and vertical offset represent an offset from the top left corner of the bounding box.
- topComputes to '0%' for the vertical position.
- rightComputes to '100%' for the horizontal position.
- bottomComputes to '100%' for the vertical position.
- leftComputes to '0%' for the horizontal position.
- centerComputes to '50%' ('left 50%') for the horizontal position if the horizontal position is not otherwise specified, or '50%' ('top 50%') for the vertical position if it is.
Example
Browser Support
The following information will show you the current browser support for the CSS transform-origin property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
