CSS 3D Transforms
0kb (built into browsers)True 3D depth for DOM elements — no JavaScript required.
See It in Action
A classic card flip effect using perspective and rotateY — hover to reveal the back face.
What is CSS 3D Transforms?
CSS 3D Transforms let you rotate, translate, and scale HTML elements in three-dimensional space — using nothing but CSS. Add perspective to a parent and rotateX(), rotateY(), translateZ() to children, and your flat DOM elements gain realistic depth.
Introduced in CSS3 and now supported in all modern browsers, 3D transforms are GPU-accelerated and perform well for UI effects. Combined with transition or @keyframes, they create card flips, perspective hovers, 3D carousels, and parallax effects — all without a single line of JavaScript or any external library.
When to Use CSS 3D Transforms
How CSS 3D Transforms Compares
CSS 3D Transforms manipulates DOM elements in 3D space. Three.js renders actual 3D scenes with meshes, lights, and textures. CSS is for UI effects, Three.js is for real 3D.
GSAP can animate CSS 3D transforms with more control (timelines, easing). Pure CSS is sufficient for simple transforms; GSAP shines for complex sequences.
CSS 3D Transforms define the spatial transformation; CSS Animations drive them over time. They work together — @keyframes can animate 3D transform properties.
Get Started with CSS 3D Transforms
<!-- No installation needed — CSS 3D Transforms are built into every modern browser -->
/* Parent needs perspective to create 3D space */
.scene {
perspective: 800px;
}
/* Child can now be rotated in 3D */
.card {
width: 200px;
height: 280px;
transform-style: preserve-3d;
transition: transform 0.6s ease;
}
.card:hover {
transform: rotateY(180deg);
}
/* Front and back faces */
.card-face {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
}
.card-back {
transform: rotateY(180deg);
}