CSS Transforms
Explore 2D and 3D transformations in CSS
Introduction to CSS Transforms
CSS transforms allow you to modify elements in two-dimensional or three-dimensional space. You can rotate, scale, move, skew, and apply perspective to elements, creating dynamic and interactive visual effects.
The transform
property accepts various functions that define the transformation to be applied. Hover over the examples below to see the transforms in action.
2D Transforms
2D transforms manipulate elements in a two-dimensional space (X and Y axes).
3D Transforms
3D transforms allow you to manipulate elements in three-dimensional space (X, Y, and Z axes). The perspective
property is often used to create a sense of depth.
Multiple Transforms
You can combine multiple transform functions in a single transform property. The transformations are applied in the order they are listed.
Transform Origin
The transform-origin
property allows you to change the point of origin for transformations. By default, transformations are applied from the center of the element.
Top Left
Center (Default)
Bottom Right
3D Card Flip Effect
A popular use of 3D transforms is to create a card flip effect. Hover over the card below to see it in action.
Front Side
Back Side
3D Cube
Using 3D transforms, you can create complex three-dimensional objects like this cube. Hover over it to see it rotate.
Practical Example: Hover Card
Transforms are commonly used to create interactive UI elements. Hover over the card below to see multiple transforms in action.
Hover Card Example
This card uses multiple transforms for a rich interactive experience.