CSS中的transform与transition
transform:转换 对元素进行移动、缩放、转动、拉长或拉伸。 方法:translate(): 元素从其当前位置移动,根据给定的 left(x 坐标) 和 top(y 坐标) 位置参数 有两个div,它们的css样式如下: 1 .before { 2 width: 70px; 3 height: 70px; 4 background-color: #8fbc8f; 5 } 6 7 .after { 8 width: 70px; 9 height: 70px; 10 background-color: #ffe4c4; 11 -webkit-transform: translate(50px, 30px); 12 -moz-transform: translate(50px, 30px); 13 -ms-transform: translate(50px, 30px); 14 -o-transform: translate(50px, 30px); 15 transform: translate(50px, 30px); 16 } 结果如下: rotate() 元素顺时针旋转给定的角度。允许负值,元素将逆时针旋转。 有两个div,它们的css样式如下 1 .before { 2 width: 70px; 3 height: 70px; 4 background-color: