Rotate Property

Last updated: 2026-09-13

rotate Rotate Property

The rotate property is an individual transform property that rotates an element around a specified axis in 2D or 3D space. As a standalone property it can be controlled separately from other transforms such as translate and scale, which is especially useful when you want to animate the rotation angle on its own.

Category
Initial Valuenone
InheritedNo
Applies To
Animation Type
CSS VersionCSS3
StatusStandard

📝 Syntax

rotate: none | <angle> | [ x | y | z | <number>{3} ] <angle>;

⚙️ Values

ValueTypeDescription
noneKeywordNo rotation
<angle>TypeThe rotation angle

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
rotate v57 v12 v52 v10.1 v44
Supported in all major browsers
Tip: When no axis is given, the element rotates around the Z axis (perpendicular to the screen). You can specify the x, y, or z axis, or a custom vector, for 3D rotation.
Tip: Positive values rotate clockwise when looking along the axis in its positive direction; negative values rotate counterclockwise.

❓ FAQ

QHow do I make an element swing back and forth instead of spinning continuously?
APlay the animation alternately in both directions: use animation-direction: alternate and write two keyframes, such as rotate: -10deg at the from frame and rotate: 10deg at the to frame. When only the to frame is written, the 0% frame automatically uses the element's initial state. You can also toggle a class with JavaScript combined with a transition.
QIs the rotate property the same as transform: rotate() in CSS?
AVisually they are identical — both rotate around the specified axis. The difference is that the standalone rotate property can be animated on its own without affecting the translate, scale, or other transforms already in transform, which is convenient for controlling each dimension separately. transform: rotate() must be written in the same list as the other transform functions, and the order of the list matters when you change it.
QWhat rotation axes does rotate support? How do I rotate around X or Y?
AWith no axis written, rotation defaults to the Z axis (perpendicular to the screen), equivalent to rotateZ. Use rotate: x 45deg for the X axis, rotate: y 45deg for the Y axis, or a custom vector such as rotate: 1 1 0 45deg. Rotations around X or Y need a perspective on the parent element to show real depth.
QDoes rotate support negative angles or angles beyond 360 degrees?
AYes. rotate: -45deg rotates 45 degrees counterclockwise, and a value above 360deg such as 720deg shows two full turns during an animation. Angles accept deg, grad, rad, and turn units — 0.25turn equals 90deg. Note that in static styles 360deg and 0deg look the same, but in an animation the full rotation is rendered.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏