Search results
Learn how to use the perspective property to give a 3D-positioned element some perspective. See examples, syntax, browser support, and related pages.
- yes. Read about animatable Try it
- no
- none
- CSS3
- Overview
- Syntax
- Description
- Examples
- Browser compatibility
The perspective CSS property determines the distance between the z=0 plane and the user in order to give a 3D-positioned element some perspective.
Values
none Indicates that no perspective transform is to be applied. A giving the distance from the user to the z=0 plane. It is used to apply a perspective transform to the children of the element. Negative values are syntax errors. If the value is smaller than 1px, it is clamped to 1px.
Each 3D element with z>0 becomes larger; each 3D-element with z<0 becomes smaller. The strength of the effect is determined by the value of this property. Large values of perspective cause a small transformation; small values of perspective cause a large transformation.
The parts of the 3D elements that are behind the user — i.e. their z-axis coordinates are 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 other than none creates a new stacking context. Also, in that case, the object will act as a containing block for position: fixed elements that it contains.
Setting perspective
An example showing how a cube varies if the perspective is set at different positions is given in Using CSS transforms > Setting perspective.
BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Jul 9, 2012 · Learn how to use the perspective CSS property to create a 3D-space for transformed elements. See demos, syntax, values, browser support and examples of perspective in action.
Sep 9, 2020 · Learn how to use the perspective property to create 3D effects with CSS animations. See examples of perspective, perspective-origin, transform, and 3D cube.
- Side by Side Perspective Loader. Compatible browsers: Chrome, Edge, Firefox, Opera, Safari. Responsive: yes. Dependencies:
- Film. 3D-looking clapperboard/slate drawn with CSS and a single HTML element. It uses perspective (which provides 3D capabilities) but also uses shadows to simulate depth).
- 3D CSS Perspective Cards with Depth. Compatible browsers: Chrome, Edge, Firefox, Opera, Safari. Responsive: yes. Dependencies: flexboxgrid.css.
- Perspective Sphere Preloader. Compatible browsers: Chrome, Edge, Firefox, Opera, Safari. Responsive: yes. Dependencies:
Aug 3, 2023 · Learn how to use CSS perspective property to give perspective to 3D objects on a 2D plane. See examples, syntax, values, and browser support for this property.
People also ask
What is perspective in CSS?
What are CSS perspective effects?
Where can I find free HTML & CSS perspective code examples?
What is a perspective property?
CSS - perspective Property. The CSS property perspective specifies the distance between the z=0 plane and the user. It helps in providing some perspective to a 3D-positioned element. The value of perspective property determines the effect's strength.