{"id":17442,"date":"2012-07-09T12:15:04","date_gmt":"2012-07-09T19:15:04","guid":{"rendered":"http:\/\/css-tricks.com\/?page_id=17442"},"modified":"2021-07-14T12:01:10","modified_gmt":"2021-07-14T19:01:10","slug":"transform-origin","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/t\/transform-origin\/","title":{"rendered":"transform-origin"},"content":{"rendered":"\n

The transform-origin<\/code> property is used in conjunction with CSS transforms, letting you change the point of origin of a transform.<\/p>\n\n\n\n

.element {\n  transform: rotate(360deg);\n  transform-origin: top left;\n}<\/code><\/pre>\n\n\n\n

As indicated above, the transform-origin<\/code> property can take up to two space-separated keyword or length values for a 2D transform and up to three values for a 3D transform.<\/p>\n\n\n\n\n\n\n\n

Using the code above on a 200px by 200px box, with the transform applied to a transitioned using a click event, would behave like this:<\/p>\n\n\n\n