Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS3 perspective-origin property

CSS3 perspective-origin property

Example

Set the base position of a 3D element:

div

{

perspective:

150

;

perspective-origin:

10

%

10

%

; -

webkit-perspective:

150

;

/*

Safari and Chrome

*/

webkit-perspective-origin:

10

%

10

%

;

/*

Safari and Chrome

*/

}

Try it »


Browser support

The numbers in the table indicate the first browser version that supports this property.

A number immediately before -webkit-, -ms-, or -moz- indicates the first browser version that supports that prefixed property.

property
perspective-origin 36.0
12.0 -webkit- 10.0 16.0
10.0 -moz- 9.0
4.0.3 -webkit- 23.0
15.0 -webkit-

Property definition and usage

The perspective-origin property defines the X and Y axes on which the 3D element is based. This property allows you to change the base position of a 3D element.

When defining the perspective-origin property, it is the perspective of an element's children, not the element itself.

Note: For Chrome and Safari users: to better understandperspectivethe property!

For Chrome and Safari users: To better understand the perspective-origin property, see View the example.

Default value: 50% 50%
Inherited: no
Version: CSS3
JavaScript syntax: object.style.perspectiveOrigin="10% 10%"

Syntax

perspective-origin:

x-axis y-axis

;

Value Description
x-axis

Defines the position of the view on the x-axis. Default value: 50%.

Possible values:

  • left
  • center
  • right
  • length
  • %
  • | | *y-axis* |

    Defines the position of the view on the y-axis. Default value: 50%.

    Possible values:

    |