码迷,mamicode.com
首页 > Web开发 > 详细

css3 transform的基本用法和介绍

时间:2016-10-04 11:51:38      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:

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

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


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

 

/*贝塞尔可以自定义(https://matthewlein.com/ceaser/)曲线过渡 由慢到快 */
.box{
width: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;
width:200px;
height:200px;
}

</style>

css3 transform的基本用法和介绍

标签:

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!