perspective

This is an experimental feature
Because this feature is still in development in some browsers, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental feature is subject to change in future version of browsers as the spec changes.

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.

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 it 0 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

  • Desktop
  • Mobile

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

See also

Tags (4)

Edit tags

Attachments (0)

 

Attach file