CSSperspective-origin Property
Example
Define at from which position the user is looking at the 3D-positioned element:
perspective: 100px;
perspective-origin: left;
}
Definition and Usage
Theperspective-origin property defines at from which position the user is looking at the 3D-positioned element.
When defining theperspective-origin property for an element, it is the CHILD elements that will get the effect, NOT the element itself.
Note: This property must be used in conjunction with theperspective property!
To better understand the perspective-origin property,view a demo.
| Default value: | 50% 50% |
|---|---|
| Inherited: | no |
| Animatable: | yes.Read aboutanimatableTry it |
| Version: | CSS3 |
| JavaScript syntax: | object.style.perspectiveOrigin="10px 50%"Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| perspective-origin | 36 | 10 | 16 | 9 | 23 |
CSS Syntax
Property Values
| Property Value | Description | Demo |
|---|---|---|
| x-axis | Defining where the view is placed at the x-axis Possible values:
Default value: 50% | Demo ❯ |
| y-axis | Defining where the view is placed at the y-axis Possible values:
Default value: 50% | Demo ❯ |
| initial | Sets this property to its default value.Read aboutinitial | |
| inherit | Inherits this property from its parent element.Read aboutinherit |
Related Pages
CSS tutorial:CSS 3D Transforms
HTML DOM reference:perspectiveOrigin property

