3D類似2D的加強版
matrix3d(n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n)
Defines a 3D transformation, using a 4x4 matrix of 16 values
translate3d(x,y,z)
Defines a 3D translation
translateX(x)
Defines a 3D translation, using only the value for the X-axis
translateY(y)
Defines a 3D translation, using only the value for the Y-axis
translateZ(z)
Defines a 3D translation, using only the value for the Z-axis
scale3d(x,y,z)
Defines a 3D scale transformation
scaleX(x)
Defines a 3D scale transformation by giving a value for the X-axis
scaleY(y)
Defines a 3D scale transformation by giving a value for the Y-axis
scaleZ(z)
Defines a 3D scale transformation by giving a value for the Z-axis
rotate3d(x,y,z,angle)
Defines a 3D rotation
rotateX(angle)
Defines a 3D rotation along the X-axis
rotateY(angle)
Defines a 3D rotation along the Y-axis
rotateZ(angle)
Defines a 3D rotation along the Z-axis
perspective(n)
透鏡革为,望遠鏡
例子
<style>
div {
width: 100px;
height: 100px;
background: red;
-webkit-transition: width 2s,height 1s; /* For Safari 3.1 to 6.0 */
transition: width 2s,height 1s;
}
div:hover {
height:400px;
width: 300px;
}
</style>
</head>
<body>
<div></div>
</body>```
[查看代碼演示](https://wujianxing.github.io/html/3d/)
``` transition: width 2s, height 4s;即,要改變的屬性
transition-timing-function 變化速度控制
ease :開始和結(jié)束都減速
linear:平均速度
ease-in:開始慢
ease-out:結(jié)束慢
cubic-bezier(n,n,n,n) 用貝塞爾曲線,自定義速度```
[查看代碼演示](https://wujianxing.github.io/html/3d/transition_speed)