The rotate property turns an element around its transform-origin. An angle alone rotates around the Z axis (flat on the screen). You can also rotate around x, y, z, or a custom 3D vector.
It is an individual transform property, like translate and scale. That lets you change rotation without rewriting a full transform list. The initial value is none. It is not inherited and creates a stacking context when not none.
Baseline · Widely available.
Not deprecated. Supported in modern browsers since about 2022. For very old browsers, fall back to transform: rotate(…).
Start at identity.rotate: 0deg keeps a stacking context stable before hover.
Transition only rotate.transition: rotate 0.25s ease animates that property.
Change on hover.rotate: 15deg tilts the button slightly.
Why individual helps. You did not need to rewrite a full transform list.
Edge Cases & Pitfalls
If the spin looks wrong, one of these is usually why.
order
Fixed apply order with translate / scale
Individual transforms always run as translate → rotate → scale → transform. Need a different order? Use transform functions instead.
origin
Wrong pivot point
Rotation swings around transform-origin. Change it when the element turns from the wrong spot.
stack
Creates a stacking context
A non-nonerotate creates a stacking context. Prefer rotate: 0deg in the base state if hover would otherwise change stacking suddenly.
3d
Axis rotations need perspective
rotate: x … / y … look flat without perspective (or a 3D context) on an ancestor.
fallback
Older browsers need transform
IE and pre-2022 engines lack rotate. Use transform: rotate(45deg) (or @supports) when you must support them.
Compatibility
Browser Support
rotate is a browser CSS property for individual transforms. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
rotate
Chrome 104+, Edge 104+, Firefox 72+, Safari 14.1+ / iOS 14.5+. Not supported in Internet Explorer.
96%Global support
Google Chrome104+
Full support
Mozilla Firefox72+
Full support
Apple Safari14.1+
Full support
Microsoft Edge104+
Full support
Opera90+
Full support
Samsung Internet20+
Full support
Internet ExplorerNo support
No support
rotateWidely supported
Bottom line: Safe for modern sites. Fall back to transform: rotate() for older browsers. This is not a JavaScript runtime API.
Remember
Key Takeaways
Role: rotate independently of the transform list — angle, axis, or vector.
Initial:none. Positive 2D angles turn clockwise.
Order: translate → rotate → scale → transform.
Pivot: control the turn point with transform-origin.
One line:rotate turns the painted box — without rewriting the whole transform stack.
Frequently Asked Questions
It rotates an element around its transform origin without using the transform shorthand. An angle alone rotates around the Z axis. You can also rotate around x, y, z, or a custom 3D vector.
Both turn the element. rotate is an individual transform property you can set and animate on its own. transform: rotate() is a function inside the older transform list and must be rewritten with any other transform functions you keep.
The initial value is none, which means no rotation. Visually that matches 0deg.
No. It changes how the element is painted. The original layout box usually stays the same, so neighbors do not reflow.
Individual transform properties always run in a fixed order: translate, then rotate, then scale, then any transform property last — regardless of source order in your CSS.
It is Baseline Widely available: Chrome 104+, Edge 104+, Firefox 72+, Safari 14.1+. It is a browser CSS property, not a Node.js feature. Prefer transform: rotate() only if you must support older browsers.