← Back to functions
CSS Function
rotate()
TransformRotates an element clockwise or counterclockwise by a given angle.
Syntax
rotate(angle)
Example
transform: rotate(45deg);
Common use cases
- Rotating icons and arrows
- Spinning loader animations
- Tilted decorative elements
Practical developer insight
Positive values rotate clockwise, negative counterclockwise. Combine with transition for smooth animated rotations on hover or state change.