Table of contents
- 1. Summary
- 2. Syntax
- 3. Examples
- 4. Specifications
- 5. Browser compatibility
- 6. See also
Summary
The perspective
CSS property determines the distance between the z=0 plane and the user in order to give to the 3D-positioned element some perspective. Each 3D element that is placed between the z=0 and the user is enlarged, each 3D-element with z<0 is shrinked. How much deformation is defined by the value of this property.
Part of the 3D-elements that are behind the user, i.e. that their z-axis coordinate is greater than the value of the perspective
CSS property are not drawn.
The vanishing point is by default placed at the center of the element, but its position can be changed using the perspective-origin
property.
Using this property with a value different than 0
and none
creates a new stacking context.
- Initial value
:
none
- Applies to : block and inline elements
- Inherited : no
- Media:
visual
- Computed value : same as specified value.
Syntax
perspective: none or
perspective: depth
where :
none
- Is a keyword indicating that no perspective transform has to be applied.
- depth
- Is a
<length>
giving the distance from the user to the z=0 plane. It used to apply a perspective transform to the element and its content. If it0
or a negative value, no perspective transform is applied.
Examples
perspective:150px; | perspective:300px; | perspective:600px; |
1 2 3 4 5 6 | 1 2 3 4 5 6 | 1 2 3 4 5 6 |
Specifications
Specification | Status | Comment |
---|---|---|
CSS 3D Transforms Level 3 | This has been merged in another draft. Please update |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 12 -webkit | 10.0 (10) -moz | 10 -ms | -- | (Yes) -webkit |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | 3.0 -webkit | 10.0 (10) -moz | ? | -- | (Yes) -webkit |