CSS perspective-origin Property

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 4 Examples
3D Transforms

What You’ll Learn

The perspective-origin property sets the vanishing point for a 3D scene. Use it with perspective to control how rotations and depth are perceived.

01

Vanishing Point

Viewer position.

02

X and Y

Two coordinates.

03

50% 50%

Default center.

04

Keywords

top, left, right.

05

Parent Scene

With perspective.

06

3D UI

Cards & panels.

Introduction

The perspective-origin property in CSS is used to define the origin point of the perspective view for a 3D transformed element.

This property controls the position from which the viewer perceives the depth and perspective of the element, affecting how 3D transformations such as rotations and translations appear.

Definition and Usage

Set perspective-origin on the same parent element that has perspective. That parent creates the 3D scene; children inside it use transforms like rotateY() or rotateX().

Moving the origin to a corner or edge changes the angle of the 3D effect, similar to moving your head while looking at a rotating card.

💡
Beginner Tip

perspective-origin does not replace perspective. You need both on the parent: distance from perspective, vanishing point from perspective-origin.

📝 Syntax

The syntax for the perspective-origin property allows you to specify the position in 2D space. It can take either two values for the X and Y coordinates or a single value for the X coordinate with the Y coordinate defaulting to 50%.

syntax.css
element {
  perspective-origin: x-axis y-axis;
}
  • x-axis — Specifies the horizontal position of the perspective origin. This can be a length (e.g., 50px) or a percentage (e.g., 50%).
  • y-axis — Specifies the vertical position of the perspective origin. This can also be a length or a percentage.

Basic Example

perspective-origin.css
.container {
  perspective: 500px;
  perspective-origin: 100% 0%;
}

.box {
  transform: rotateY(45deg);
}

Syntax Rules

  • Apply on the parent that also has perspective.
  • Use two values (x y), one value (x defaults y to 50%), or keywords like top right.
  • Percentages are relative to the size of the perspective element.
  • Keywords such as left, center, and bottom are valid position values.
  • Pair with child transform rules to see the visual change.
  • Small origin shifts can create noticeably different 3D compositions.

🎯 Default Value

The default value of the perspective-origin property is 50% 50%. This means that the perspective origin is positioned at the center of the element.

⚡ Quick Reference

QuestionAnswer
Initial value50% 50%
Applies toElements with perspective (parent scenes)
InheritedNo
AnimatableNo
Common useShift the 3D vanishing point in cards and galleries

💎 Property Values

The perspective-origin property accepts lengths, percentages, and position keywords.

ValueExampleDescription
<length>perspective-origin: 20px 40px;A specific distance from the left edge (X) or top edge (Y).
<percentage>perspective-origin: 50% 50%;A percentage relative to the element dimensions. 50% is the center.
<position>perspective-origin: top right;Keyword positions such as left, center, bottom, and combinations.
initialperspective-origin: initial;Sets the property to its default value (50% 50%).
inheritperspective-origin: inherit;Inherits the value from the parent element.
50% 50% 100% 0% left center right bottom

When Does perspective-origin Matter?

perspective-origin fine-tunes 3D scenes after you have already set a perspective distance:

  • Product cards — Tilt toward the user from a corner origin.
  • Hero panels — Make depth feel like it comes from the left or right side.
  • Dashboard tiles — Align multiple 3D panels to a shared vanishing point.
  • Hover reveals — Change perceived rotation direction with origin shifts.

Without perspective on the parent, changing perspective-origin alone will not create a 3D scene.

👀 Live Preview

The same rotateY(45deg) looks different when the vanishing point moves from center to left center.

50% 50%

left center

Examples Gallery

Start with the top-right origin example, compare horizontal and vertical origins, and use keyword positions with hover motion.

🖼 Basic Origin Setup

Set perspective-origin on the parent scene with perspective — matching the reference example, corrected for proper placement.

Example 1 — Top-Right Perspective Origin

In this example, we’ll set the perspective origin to the top-right corner of a 3D scene container.

perspective-origin-example.html
<style>
  .container {
    perspective: 500px;
    perspective-origin: 100% 0%;
  }

  .box {
    width: 200px;
    height: 200px;
    background-color: lightcoral;
    transform: rotateY(45deg);
  }
</style>

<h1>Perspective-Origin Example</h1>
<div class="container">
  <div class="box"></div>
</div>
Try It Yourself

How It Works

The perspective origin is set to the top-right of the .container. The perspective property on the same parent ensures the 3D effect is visible on the rotated .box.

Example 2 — Center vs Left Origin

Compare the default center origin with left center using the same rotation on both cards.

perspective-origin-compare.html
<style>
  .scene { perspective: 600px; }
  .center-scene { perspective-origin: 50% 50%; }
  .left-scene { perspective-origin: left center; }
  .card { transform: rotateY(45deg); }
</style>
Try It Yourself

How It Works

Both scenes share the same perspective distance and child rotation. Only the vanishing point moves, which changes how the depth is perceived.

↕ Vertical & Keyword Origins

Shift the vanishing point along the Y axis or use readable keyword positions.

Example 3 — Top vs Bottom Origin

Use top center and bottom center with rotateX to see vertical origin changes.

perspective-origin-vertical.html
<style>
  .top-origin {
    perspective: 700px;
    perspective-origin: top center;
  }

  .bottom-origin {
    perspective: 700px;
    perspective-origin: bottom center;
  }

  .panel { transform: rotateX(35deg); }
</style>
Try It Yourself

How It Works

Vertical origins pair naturally with rotateX. The panel appears to hinge from the top or bottom depending on the origin you choose.

Example 4 — Keyword Origin with Hover

Use right bottom as the vanishing point for a tile that flattens on hover.

perspective-origin-keywords.html
<style>
  .scene {
    perspective: 800px;
    perspective-origin: right bottom;
  }

  .tile {
    transform: rotateY(30deg) rotateX(12deg);
    transition: transform 0.45s;
  }

  .scene:hover .tile {
    transform: rotateY(0deg) rotateX(0deg);
  }
</style>
Try It Yourself

How It Works

Keyword origins are easier to read than percentages in many layouts. Here the scene appears anchored toward the bottom-right corner.

perspective-origin vs perspective

perspective sets how far away the viewer is. perspective-origin sets where the viewer is looking on the 2D plane of the parent.

Use both on the same parent scene wrapper. Distance controls strength; origin controls direction and composition.

perspective-pair.css
.scene {
  perspective: 800px;
  perspective-origin: left center;
}

.panel {
  transform: rotateY(30deg);
}

🧠 How perspective-origin Works

1

Parent creates a 3D scene

The parent gets perspective so children can render in 3D.

perspective
2

You set the vanishing point

perspective-origin moves the viewer’s focal point across the parent.

origin
3

Children transform in 3D

Rotations and translations are projected relative to that origin.

transform
=

Directed 3D composition

Depth feels like it comes from a chosen corner, edge, or center point.

Browser Compatibility

The perspective-origin property is supported in all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. However, be sure to test across different devices and browsers to confirm consistent behavior.

3D Transforms · Widely supported

Reliable perspective-origin support

Chrome, Firefox, Safari, Edge, and Opera support perspective-origin with perspective.

97% Modern browser support
Google Chrome 36+ · Desktop & Mobile
Full support
Mozilla Firefox 16+ · Desktop & Mobile
Full support
Apple Safari 9+ · macOS & iOS
Full support
Microsoft Edge 79+ · Chromium
Full support
Opera 23+ · Modern versions
Full support

Testing tip

Compare origin positions on phones and desktops. A corner origin that looks good on desktop may feel too extreme on small screens.

perspective-origin property 97% supported

Bottom line: perspective-origin is safe to use in modern 3D UI. Always pair it with perspective on the same parent.

Conclusion

The perspective-origin property is essential for controlling the depth and perspective of 3D transformed elements.

By adjusting the perspective origin, you can influence how 3D transformations are perceived, allowing for more dynamic and visually interesting effects. Experiment with different values to see how the perspective changes and enhance the depth of your web designs.

💡 Best Practices

✅ Do

  • Set perspective-origin on the same parent as perspective
  • Start with 50% 50% and adjust in small steps
  • Use keywords like top right for readable layout code
  • Match origin direction to your intended motion axis
  • Test 3D scenes on touch devices

❌ Don’t

  • Put perspective-origin only on the rotated child
  • Expect results without perspective on the parent
  • Confuse perspective-origin with transform-origin
  • Use extreme corner origins without checking readability
  • Overload pages with many competing 3D vanishing points

Key Takeaways

Knowledge Unlocked

Five things to remember about perspective-origin

Use these points when aiming your 3D scenes.

5
Core concepts
02

50% 50%

Center default.

Default
📏 03

X and Y

Two coordinates.

Syntax
🖼 04

Parent Scene

With perspective.

Pattern
p 05

perspective

Viewing distance.

Companion

❓ Frequently Asked Questions

The perspective-origin property sets the vanishing point for a 3D scene. It controls where the viewer appears to be looking from on the element that has perspective applied.
Apply perspective-origin on the same parent element that has perspective, not on the child being rotated. The parent defines the 3D viewing context.
The default value is 50% 50%, which places the vanishing point at the center of the element.
Yes. Keywords such as left, right, top, bottom, and center work as position values, similar to background-position and transform-origin.
Yes. perspective-origin only affects elements that establish a 3D perspective context, which means you need perspective on the same parent element.

Practice in the Live Editor

Open the HTML editor, set perspective and perspective-origin on a parent, and rotate child elements in 3D.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful