rotate()
The rotate() transform function turns an element around its transform origin by an angle.
Syntax
rotate(<angle>) Examples
.chevron {
transition: transform 0.2s;
}
[aria-expanded='true'] .chevron {
transform: rotate(180deg);
}
Output
Flips a disclosure chevron 180 degrees when its control is expanded.
Notes
Positive angles rotate clockwise. Units include deg, turn, and rad. Change the pivot with transform-origin. The standalone rotate property and 3D rotate3d() also exist.
Browser & runtime support
| Environment | Since version |
|---|---|
| chrome | 36 |
| firefox | 16 |
| safari | 9.0 |
| edge | 12 |