3D Transforms: rotateX rotateY translateZ
Rotate and move elements in three-dimensional space using 3D CSS transform functions.
3D Transform Overview
CSS 3D transforms extend the 2D system into a third dimension using the Z axis. Enable 3D with a perspective on the parent and transform-style: preserve-3d for nested 3D elements.
rotateX()
rotateX(angle) rotates an element around the horizontal X axis — like flipping a page toward or away from you.
.page {
perspective: 800px;
}
.page .leaf {
transform: rotateX(30deg); /* tilts top toward viewer */
}All lessons in this course
- Translate Rotate and Scale
- Skew and Matrix Transforms
- Transform Origin and Perspective
- 3D Transforms: rotateX rotateY translateZ