CSS rotate Property
Description
The rotate property exposes rotation as a first-class transform on an element, letting authors apply a rotational transform independently of other transform functions. Where traditionally authors combined rotations with scales and translations using the composite transform shorthand, rotate isolates rotation so it can be authored, overridden, or animated separately and more declaratively. Conceptually it rotates the element’s visual rendering in its local coordinate space, affecting only the painted representation rather than the element’s layout box.
The pivot point for that rotation is determined by the element’s transform origin, which controls the point around which the visual rotation occurs and therefore strongly influences the motion and final placement of rotated content. Use of transform-origin lets you change whether an element spins around its center, a corner, or any specified anchor, which is essential for creating natural-looking rotations (for example, a door swinging on a hinge versus a wheel turning). Because rotation operates on the visual output, the document flow and surrounding layout remain based on the element’s original unrotated box.
Rotation changes can affect stacking, compositing, and interaction in ways worth considering: any non-identity transform typically promotes the element to its own composite layer and can create a new stacking context, which impacts how it is painted relative to siblings and may improve or worsen performance depending on frequency of updates. For smooth changes, authors commonly pair rotate with CSS animation primitives such as transition or animation, and may use will-change to hint the browser about upcoming changes. Hit-testing and pointer events follow the transformed geometry, so rotated elements respond to input where they are visually rendered rather than at their original axis-aligned box.
In practice, rotate is a powerful tool for micro-interactions, iconography, and complex UI motion because it keeps rotation semantics clear and composable. Designers should be mindful of legibility and accessibility: heavy or unexpected rotation of text and controls can confuse users and assistive technologies, so use rotation sparingly for decorative or clearly-signposted effects. When combining rotations with other visual transforms, think in terms of separate transform layers and the visual stacking they produce to avoid surprises in rendering and interaction.
Definition
- Initial value
- none
- Applies to
- transformable elements
- Inherited
- no
- Computed value
- as specified
- Animatable
- a transform
- JavaScript syntax
- object.style.rotate
Interactive Demo
Syntax
rotate: none | axis | angle | vector angle
Values
- noneSpecifies that no rotation should be applied.
- axisOptional. If not set, z-axis is default. Defines axis to rotate element around. Possible values: x, y, z
- angleDefines how much an element is rotated. Possible units: deg, rad, turn
- vector angleThree numbers define a vector for the element to be rotated around. The numbers are x-, y- and z-coordinates for the vector, respectively. The last value is the angle for how much to rotate. Possible values: number, number, number, angle
Example
Browser Support
The following information will show you the current browser support for the CSS rotate 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
