Free visual CSS tool

CSS Perspective Playground

See exactly what the perspective and perspective-origin properties do, isolated from other 3D transforms, on a live three-card scene. Adjust distance and vanishing point, then copy the CSS.

1
2
3
Ready-to-use CSS

One property, isolated and explained

This playground deliberately leaves rotation and translateZ fixed on the demo cards, so the only thing changing when you move a slider is perspective itself.

Distance slider

Move from 200px to 2000px and watch depth go from dramatic to nearly flat.

Vanishing point control

Drag perspective-origin X and Y to shift where the 3D scene converges.

Copy the stage CSS

Get a ready-to-use .stage rule with both properties set correctly.

How to use the perspective playground

Three sliders and a toggle are all you need to understand this property.

  1. Set the distanceDrag the distance slider; smaller values push the viewer closer for a stronger 3D effect.
  2. Move the vanishing pointAdjust origin X and Y to shift where the scene converges, just like moving a camera.
  3. Toggle auto-rotateTurn on auto-rotate to spin the scene slowly and make the depth change easier to see.

About the CSS perspective property

The perspective property is what turns flat, rotated elements into something that actually looks three-dimensional. Without it, transforms like rotateY or translateZ still technically apply, but there is no vanishing point for the browser to render toward, so the result looks like a flat, skewed shape rather than real depth. Setting perspective on a parent element defines how far away the viewer is from the z=0 plane: a small value places the viewer very close, exaggerating depth dramatically, while a large value places the viewer far away, flattening the scene almost back to 2D. The perspective-origin property works alongside it, moving the vanishing point itself, which is what makes elements appear to recede toward a corner instead of dead center.

Perspective vs. transform: perspective()

Setting perspective on a parent applies to every 3D child consistently. Using the perspective() function inside an individual transform only affects that one element.

preserve-3d matters

Child elements need transform-style:preserve-3d on their parent to keep their own 3D positioning instead of being flattened into the page.

Typical distance values

Values around 600px to 1200px feel natural for UI cards and modals; very small values under 300px create an exaggerated, almost fisheye look.

Common use cases

Card flips, tilt-on-hover effects, rotating cubes and parallax-style scenes all rely on perspective being set correctly on their container.

CSS perspective playground FAQ

What does the CSS perspective property do?

It sets the distance between the viewer and the z=0 plane of a 3D scene, controlling how dramatic the apparent depth of child elements looks.

What is the difference between perspective and perspective-origin?

perspective sets how close the viewer is to the scene, while perspective-origin sets the X and Y position of the vanishing point that the 3D scene converges toward.

Why isolate perspective from other 3D transforms?

Combining rotation and translateZ on the same element at once makes it hard to tell what perspective alone is doing. Isolating it here makes the effect of the property clear.

Does a smaller perspective value mean more or less depth?

A smaller value places the viewer closer to the scene, which creates a more dramatic, exaggerated depth effect. Larger values flatten the 3D effect.

Is this tool free and private?

Yes. It is completely free, requires no account, and every calculation happens locally in your browser.

Try other CSS 3D and shape tools

Keep exploring depth, motion and shape with these free online CSS tools.