Click the "Try it" button to set the origin of the rotation to 0 for both the x-axis and the y-axis:

Note: The grey DIV element indicates where the DIV2 element would be without the transformation.

DIV1
DIV2
DIV2

Note: Internet Explorer 8 and earlier versions do not support the transformOrigin property.

Note: Internet Explorer 9 supports an alternative, the msTransformOrigin property. Newer versions of IE support the transformOrigin property (do not need the ms prefix)

Note: Chrome, Safari and Opera supports an alternative, the WebkitTransformOrigin property.