English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
perspective-Definition of origin attribute 3The X-axis and Y-axis based on the D element. This attribute allows you to change 3The bottom position of the D element. Defines the perspective when-Origin attribute, which is a child element of the element, perspective, rather than the element itself.
The following table provides usage instructions and version history of this attribute, as well as the syntax used in JavaScript scripts.
Default value: | 50P% |
---|---|
Applies to: | Transformable elements |
Inheritance: | None |
Animated: | Yes.Please refer to Animation properties. |
Version: | CSS3New feature |
JavaScript syntax: | object.style.perspectiveOrigin="20%" |
The syntax of this attribute is as follows:
perspective-origin: [ x-position y-position ] | initial | inherit
Note:If only for perspective-The origin attribute specifies a value, then the second value is assumed to be the center, equal to50% value.
The following example demonstrates how to use perspective-origin Attribute.
.container{ width: 125px; height: 125px; perspective: 300px; perspective-origin: 20% top; border: 4px solid #a2b058; background: #f0f5d8; } .transformed { -webkit-transform: rotate3d(0, 1, 0, 60deg); /* Chrome, Safari, Opera */ transform: rotate3d(0, 1, 0, 60deg); }Test to see‹/›
Note:If at least one of the two values is not a keyword, the first value represents the horizontal position (or offset) of the origin of the perspective, and the second value represents the vertical position (or offset) of the origin of the perspective.
The following table describes the values of this attribute.
Value | Description |
---|---|
x-axis | It represents the horizontal position (or offset) of the origin of the perspective. It can have one of the following values:
|
y-axis | It represents the vertical position (or offset) of the origin of the perspective. It can have one of the following values:
|
initial | Set this attribute to its default value. |
inherit | If specified, the associated elements adopt the perspective of their parent element.-The Attribute Values of origin. |
perspective-Browser Compatibility of the origin Attribute, the numbers in the following table indicate the minimum version number of the browser that supports this attribute; all mainstream browsers support this attribute.
|
Please refer to the following tutorials:CSS3 3D Transformation.
Related Attributes:perspective,backface-visibility,transform,transform-origin,transform-style.