Perspective

The perspective property controls the perspective for 3D transformation.

Perspective Properties

perspective

Controls the distance between the user and the z = 0 plane. Specify:

  • noneno perspective transform is to be applied
  • a lengthe.g. 800px, the distance from the user to the z = 0 plane

3D elements with z > 0 becomes larger; 3D elements with z<0 becomes smaller. The strength of the effect is determined by the value of perspective. Also, the parts of the 3D elements behind the user are not drawn.

perspective-origin

Sets the vanishing point for perspective. Specify:

  • a keyworde.g. center, top, or top left
  • a pair of lengths/percentagese.g. 10px 10px or 25% 125% (denoting where the vanishing point is on the x and y axes)

Other Properties

backface-visibility

Sets whether the back face of an element is visible when the back face is facing the user. (Only makes sense in 3D space, with 3D transformations.)

  • visiblerender it (mirror image of the front face) (default)
  • hiddenhide it (making the element invisible when turned away from the user)

Example

This example is taken from https://developer.mozilla.org/en-US/docs/Web/CSS/perspective-origin

| LIVE PREVIEW
1
2
3
4
5
6

References