The transform-origin property lets you modify the origin for transformations of an element. For example, the transform-origin of the rotate() function is the centre of rotation.

  • Initial value50% 50%
  • Applies toTransformable elements
  • InheritedNo
  • MediaVisual
  • Computed valueFor <length> the absolute value, otherwise a percentage
  • AnimatableYes
  • CSS VersionCSS3
  • JavaScript syntaxobject.style.transformOrigin
Formal syntax: [ 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>?

transform-origin: [value];

  • <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.
.class {
   transform-origin: 20%;
}
?Firefox?Explorer?Chrome?Safari?Opera


Last updated on 23rd March 2014 By Rene Spronk

View All CSS Properties

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.