目前只的safari支持(Available in Safari 4.0.3 and later running)
apple官方解释:
Specifies a perspective projection matrix.
perspective(depth)
Parameters
depth
The distance, in pixels, of the z=0 plane from the viewer.
Discussion
This matrix maps a viewing cube onto a pyramid whose base is infinitely far away from the viewer and whose peak represents the viewer’s position.
The viewable area is the region bounded by the four edges of the viewport (the portion of the browser window used for rendering the webpage between the viewer’s position and a point at a distance of infinity from the viewer).
Lower values for this property give a more flattened pyramid and therefore a more pronounced perspective effect. A value of 1000 pixels gives a moderate amount of foreshortening, and a value of 200 pixels gives an extreme amount
大概意思:从观察者到Z轴平面的距离,单位px(3D效果是由我们人眼和物体之间距离产生的,所以不同的depth值会有不同的纵深效果),还是用效果来说吧。
代码如下:
该属性只会对子元素起作用,而对本身没有影响。
子元素要配合旋转效果才能看到效果(^^平面怎么也看不到纵深效果哈),并且指定-webkit-transform-origin否则随着父节点的定宽会出现奇怪效果。