Set a 3D element's base placement:
document.getElementById("myDIV").style.perspectiveOrigin = "10px 50%";
Try it Yourself »
The perspectiveOrigin property defines where a 3D element is based in the x- and the y-axis. This property allows you to change the bottom position of 3D elements.
When defining the perspectiveOrigin property for an element, it is the CHILD elements that are positioned, NOT the element itself.
Note: This property must be used together with the perspective property, and only affects 3D transformed elements!
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
perspectiveOrigin | 36.0 | 10.0 | 16.0 | 6.1 | 23.0 |
Return the perspectiveOrigin property:
object.style.perspectiveOrigin
Set the perspectiveOrigin property:
object.style.perspectiveOrigin
= "x-axis y-axis|initial|inherit"
Value | Description |
---|---|
x-axis | Defining where the view is placed at the x-axis Possible values:
Default value: 50% |
y-axis | Defining where the view is placed at the y-axis Possible values:
Default value: 50% |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | 50% 50% |
---|---|
Return Value: | A String, representing the perspective-origin property of an element |
CSS Version | CSS3 |
JavaScript Style Object: perspective property
CSS reference: perspective-origin property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!