transform-origin
Widely availableSince 201597% of users
Sets the anchor point for a transform. For example, if you rotate a square, 'transform-origin' decides if it spins around its center, one of its corners or even a point outside the square entirely.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyClassic, with newer partsIt has worked everywhere since September 2015, and it keeps getting newer values.
Newer parts of transform-origin
On SVG elementsBaseline Apr 2018, Widely Oct 2020
See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
50% 50% 0- Inherited
- No
- Applies to
- transformable elements
- Animation type
- simpleListOfLpc
Quick example
.door {
/* Fixes the 'hinge' point to the left side so the door opens correctly when rotated */
transform-origin: left center;
transition: transform 0.5s;
}
.door:hover {
transform: perspective(600px) rotateY(-45deg);
}Values
leftcenterrighttopbottomtransform-origin browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.Safe to use without fallbacks.
Usage97%of people can use this3% use a browser without it.
Browsers
36+
16+
9+
12+Mobile
36+Android
16+Android
9+iOS