Rotate about an axis

rotate

Apply simplified matrix algebra to rotate an element about the x, y or z axis.

Property values

This is an alias for the transform property. It may be specified in any of these forms:

syntax form equivalent
rotate: θ transform: rotate(θ);
rotate: x θ transform: rotateX(θ);
rotate: y θ transform: rotateY(θ);
rotate: z θ transform: rotateZ(θ);
rotate: dx dy dz θ transform: rotate3d(dx, dy, dz, θ);

Variable units

Each of the values for (dx, dy, dz) are unitless numbers.

The units for rotating angles (θ) may be any of these:

unit meaning
deg degrees
rad radians
grad gradians
turn 1 turn of the circle

Examples

/* rotate 90 degrees about the z axis */            
rotate: z 90deg;
rotate

style > transform > rotateRotate about an axis

Q