What is the difference between perspective and transform's perspective properties in CSS?

后端 未结 4 1026
庸人自扰
庸人自扰 2020-12-10 02:06

In our application we use a temporary css transform as a page transition.

With the latest build of google chrome (37) this stopped working. The transformation has no

4条回答
  •  無奈伤痛
    2020-12-10 02:53

    To activate 3D space, an element needs perspective. This can be applied in two ways: using the transform property, with the perspective as a functional notation.

    transform: perspective( 600px );
    

    or using the perspective property:

    perspective: 600px;
    

    Perspective Projection vs. Perspective Transformation

    Perspective Projection calculates the perspective view (i.e., foreshortening) of a 3D object onto a 2D projection plane. The effect of viewing in perspective is achieved, and, of course, the z-values (depth information) are discarded in the process.

    Perspective Transformation allows us to see how the perspectively foreshortened and projected polygons will overlap, without discarding the z-values (which we need to use later for depth comparison).

提交回复
热议问题