CSS 3D Flip Card Generator
Design production-ready 3D flip cards visually. Customize rotation axis, perspective, timing, and triggers. Generate clean, copy-paste HTML & CSS.
Front Side
Hover/Click me!
Back Side
Hidden Content
* You can edit text directly on the card
About
This tool generates the complex CSS required to create hardware-accelerated 3D flip animations. Unlike simple 2D transitions, 3D flips require a precise combination of perspective, transform-style, and backface-visibility to function correctly across browsers.
The core mechanic relies on rotating a container 180 degrees (180°) along an axis. To create the illusion of depth, we define a perspective value, typically between 600px and 1200px. This value represents the distance of the viewer's eye from the z=0 plane. Lower values create a more dramatic, "fisheye" 3D effect, while higher values appear flatter.
We solve the "flicker" problem often seen in older implementations by strictly enforcing preserve-3d on the inner container and hiding the backface of the card faces. This ensures that when the card rotates x > 90°, the browser rendering engine correctly culls the front face.
Formulas
The rotation transformation matrix Ry for a horizontal flip (θ) is calculated by the browser rendering engine as:
When θ = 180°, the visual output is inverted along the Z-axis relative to the viewer's perspective origin.
Reference Data
| Property | Value Type | Function |
|---|---|---|
| perspective | px | Determines the depth of the 3D scene. Standard range: 600px - 1200px. |
| transform-style | preserve-3d | Tells the browser that children of the element should be positioned in 3D space, not flattened. |
| backface-visibility | hidden | Hides the rear side of a generic element, crucial for the "card" effect. |
| rotateY | deg | Rotates the element around the vertical Y-axis (Horizontal flip). |
| rotateX | deg | Rotates the element around the horizontal X-axis (Vertical flip). |
| transition | ms / s | Defines the interpolation curve (e.g., cubic-bezier) and duration of the flip. |