CSS rotateZ() Function
Example
Use rotateZ() to rotate several <div> elements around the z-axis:
#myDiv1 {
transform: rotateZ(40deg);
}
#myDiv2 {
transform: rotateZ(60deg);
}
#myDiv3 {
transform: rotateZ(-45deg);
}
Try it Yourself »
More "Try it Yourself" examples below.
Definition and Usage
The CSS rotateZ()
function defines a 3D
rotation of an element around the z-axis.
The rotateZ()
function is used within the
transform property.
Tip: rotateZ(angle)
is equal to rotate(angle)
.
Version: | CSS Transforms Module Level 2 |
---|
Browser Support
The numbers in the table specify the first browser version that fully supports the function.
Function | |||||
---|---|---|---|---|---|
rotateZ() | 12 | 12 | 10 | 4 | 15 |
CSS Syntax
rotateZ(angle)
Value | Description |
---|---|
angle | Required. Specifies the angle of rotation. Possible units:
|
More Examples
Example
Use rotateZ() to rotate images around the z-axis:
#img1 {
transform: rotateZ(40deg);
}
#img2 {
transform: rotateZ(60deg);
}
#img3 {
transform: rotateZ(-45deg);
}
Try it Yourself »
Related Pages
CSS reference: CSS transform property.
CSS reference: CSS rotate property.
CSS reference: CSS rotate() function.
CSS reference: CSS rotate3d() function.
CSS reference: CSS rotateX() function.
CSS reference: CSS rotateY() function.
CSS tutorial: CSS 3D transforms.