Browse documentation

Reference / Transforms

Perspective

Set the viewer’s distance from a three-dimensional scene and choose its vanishing point on the parent.

Working example

Smaller distances exaggerate depth. The perspective property belongs on the parent of the rotated or translated object.

HTML
<div class="perspective-[300px] perspective-origin-[left_center]">
  <span class="inline-block transform-[rotateY(32deg)] border bg-neutral-100 px-6 py-3">Front cover</span>
</div>

Class reference

ClassCSS declarations
perspective-[300px]perspective: 300px;
perspective-[800px]perspective: 800px;
perspective-[none]perspective: none;
perspective-origin-[center_top]perspective-origin: center top;
View full generated CSS
Compiled CSS
.perspective-\[300px\] {
  perspective: 300px;
}
.perspective-\[800px\] {
  perspective: 800px;
}
.perspective-\[none\] {
  perspective: none;
}
.perspective-origin-\[center_top\] {
  perspective-origin: center top;
}