CSS perspective-origin property
Browser support · legacy reference
ChromeFully supports
SafariFully supports
FirefoxFully supports
Internet ExplorerPartial support
EdgeFully supports
OperaFully supports
Description
CSS perspective-origin property represents the origin of perspective property. This point is located with respect to top and left edges of the element where a user seems to be looking at the transformation of children elements.
There are two possible values (X and Y). If only one value is specified, the second one is assumed to be the 'center'.
Syntax
perspective-origin : [ percentage | length | left | center | right] [percentage | length | top | center | bottom]
Property values
percentage percentageDefault
-
The perspective origin is at 50% from top side and 50% from left side. It is the same as perspective-origin: center center;.
- Try it
perspective-origin: 50% 50%; percentage percentage
-
The perspective origin is at 30% from top side and 40% from left side.
- Try it
perspective-origin: 30% 40%; length length
-
The perspective origin is at 30px from top side and 40px from left side.
- Try it
perspective-origin: 30px 40px; right bottom
-
The perspective-origin is the bottom right corner. It is the same as perspective-origin: 100% 100%;.
- Try it
perspective-origin: right bottom; left top
-
The perspective-origin is the top left corner. It is the same as perspective-origin: 0% 0%;.
- Try it
perspective-origin: left top; center top
-
The perspective-origin is the top center. It is the same as perspective-origin: 50% 0%;.
- Try it
perspective-origin: center top; top
-
Since the second value is not present, it is assumed to be 'center'. It is the same as perspective-origin: center top;.
- Try it
perspective-origin: top;
Applicable to
It applies to transformable elements.