Rotating, Scaling, Skewing, 3D Perspective & Interactive Card Flips
2D transforms manipulate elements without disrupting the surrounding document flow layout.
.target {
transition: transform 0.4s ease;
}
.target:hover {
transform: rotate(45deg) scale(1.1);
transform-origin: center center; /* Default anchor */
}
Using perspective: 1000px;, transform-style: preserve-3d;, and backface-visibility: hidden; to build a realistic 3D flipping card.
.card-container { perspective: 1000px; }
.card-inner { transform-style: preserve-3d; transition: transform 0.7s; }
.card-container:hover .card-inner { transform: rotateY(180deg); }
.front, .back { backface-visibility: hidden; position: absolute; }
.back { transform: rotateY(180deg); }
Simulate isometric 3D illustrations using combined 3D rotations and translateZ depth offsets.
.stack {
transform: rotateX(60deg) rotateZ(-45deg);
transform-style: preserve-3d;
}
.layer-1 { transform: translateZ(0px); }
.layer-2 { transform: translateZ(30px); }
.layer-3 { transform: translateZ(60px); }
/* Hover expands the Z spacing between layers! */