Perspective-origin - CSS Property
Summary of characteristics of the perspective-origin property
50% 50%Computed value: during an animation, the perspective-origin property gradually changes from one value to another.Per grammar: serialization in the order of syntax.Syntax diagram of perspective-origin.
perspective-origin property.The links in the diagram provide more details about the values.
Download the diagram in SVG.
In the diagram, the bold terms are the predefined words of CSS, the other terms are described below:
length-xandlength-yare two numerical values followed by one of CSS dimension units. They can also be percentages calculated relative to the dimensions of the element.
Description of the perspective-origin property.
The property perspective-origin defines the observer's position in the case of a 3D transformation with perspective. Also refer to the transform
properties to apply a transformation and perspective to set the perspective effect.
The properties perspective and perspective-origin are to be applied to the parent element, but their effect will be visible on the children
of this element.
perspective-origin expects two values that correspond respectively to the horizontal position of the observer and to their vertical position.
Example: perspective-origin:left 20%; sets the observation point on the left of the parent and at 20% of its height.
For perspective-origin to produce a visible effect, two conditions must be met:
- The property
perspectivemust have a value different fromnone. - The element on which
perspective-originis applied must have children that have undergone one or more of the following transformations: rotation around the X axis, rotation around the Y axis, movement along the Z axis.
Values for perspective-origin.
- perspective-origin: left bottom; x y
Two values, separated by a space, to position the observation point.
The first value (
x) defines the horizontal position (along the X axis). This can beleft,center,right, a dimension, or a percentage. In the latter case, the value is evaluated relative to the width of the element.The second value (
y) defines the horizontal position (along the X axis). It can beleft,center, orright, a dimension, or a percentage, evaluated relative to the height of the element.If only one value is specified, the other is set to
centerby default.ABCperspective-origin:center;ABCperspective-origin:left bottom; - perspective-origin: 40px 80px; x y
The position of the observation point can be specified by two numerical values, positive or negative, and followed by a unit of measurement (see CSS dimension units).
Percentages are calculated relative to the dimensions of the element, the width for the calculation of
xand the height for the calculation ofy.If only one value is specified, it is taken for the horizontal positioning of the observer's point, the vertical position then being equal to
center.ABCperspective-origin:40px -30px;ABCperspective-origin:10% 50%; - perspective-origin: initial; (
50% 50%) perspective-origin: inherit; perspective-origin: revert; perspective-origin: revertLayer; perspective-origin: unset;See the following pages for more details:
initial,inherit,revert,revert-layer,unset.
Animation of the perspective-origin property.
The movement of the origin point by animating the property perspective-origin enhances the 3D effect.
In this example, the properties perspective and perspective-origin are applied to the parent block, while the transformation is applied
to the image (a 10-degree rotation around the Y-axis).
Simulator.
To facilitate understanding, the simulator below shows the effect of the property perspective-origin on animated elements, but it is not essential:
the property acts as soon as there is a 3D transformation, animated or not.
The eye indicates where the origin point is placed for the perspective calculation. The effect is seen on the animated elements, which are deformed differently depending on the location of this point.
Browsers compatibility with perspective-origin.
La propriété perspective-origin ne présente pas de problème de compatibilité avec les navigateurs récents.
the backface-visibility property.perspective-origin property which defines the offset of the observer (3D animations).Notes:
(1) Internet Explorer does not support transform-style:preserve-3d, thus limiting the nesting of animations.
transformations
perspective-originproperty
Browsers on computers :
Mobile browsers :
Outdated or marginal browsers :

Internet Explorer

KaiOS Browser

Opéra Mobile

Opéra

Firefox pour Androïd

Samsung Internet

Chrome

Edge

Firefox

Androïd Brower

Chrome pour Androïd

Baidu Browser

QQ Browser

Safari

Safari sur IOS

UC Browser pour Androïd

Opéra mini
Historic of the perspective-origin property.
-
CSS Transforms Module Level 2
In addition to the 2D transformations already presented in level 1 of the specification, this module deals with 3D transformations. It introduces new properties to manage the viewpoint height and the rendering of 3D effects.
This module also introduces the individual properties of rotation, translation, and zoom effect.Regardingperspective-origin. Introduction of 3D transformations and theperspective-originproperty in the transformation specification.March 03, 2020Working Draft.
See also, about transformations.
The CSS Transforms Module includes everything related to CSS transformations:
Properties:
Functions:





