css3 transform的基本用法和介绍

<style>
/* 最简单的一个transition动画
.box{100px;height:100px;border:1px solid;background:green;-webkit-transition:3s;}
.box:hover{200px;height:200px;background:pink;} */

/* transition宽度需要3s,背景需要5s
.box{100px;height:100px;border:1px solid;background:green;-webkit-transition:3s width,background 5s;}
.box:hover{200px;height:200px;background:pink;} */


/* transition宽度3s完成,高度5秒开始,2秒完成
.box{100px;height:100px;border:1px solid;background:green;-webkit-transition:3s width,height:5s 2s;}
.box:hover{200px;height:200px;background:pink;} */

/*贝塞尔可以自定义(https://matthewlein.com/ceaser/)曲线过渡 由慢到快 */
.box{
100px;height:100px;border:1px solid #000;background:red;
transition:5s background;transition:2s width;

-webkit-transition: all 500ms cubic-bezier(0.570, 0.070, 1.000, 0);
-webkit-transition: all 500ms cubic-bezier(0.570, 0.070, 1.000, -0.075);
-moz-transition: all 500ms cubic-bezier(0.570, 0.070, 1.000, -0.075);
-o-transition: all 500ms cubic-bezier(0.570, 0.070, 1.000, -0.075);
transition: all 500ms cubic-bezier(0.570, 0.070, 1.000, -0.075);
}
.box:hover{
background:blue;
200px;
height:200px;
}

</style>

原文地址:https://www.cnblogs.com/cuidan9495/p/5930146.html