5.4 CSS3 transition动画
1、transition-property 设置过渡的属性,比如:width height background-color
2、transition-duration 设置过渡的时间,比如:1s 500ms
3、transition-timing-function 设置过渡的运动方式
- linear 匀速
- ease 开始和结束慢速
- ease-in 开始是慢速
- ease-out 结束时慢速
- ease-in-out 开始和结束时慢速
- cubic-bezier(n,n,n,n)
- 比如:cubic-bezier(0.845, -0.375, 0.215, 1.335)
- 曲线设置网站:https://matthewlein.com/ceaser/
4、transition-delay 设置动画的延迟
5、transition: property duration timing-function delay 同时设置四个属性
举例:
<style type="text/css"> .box{ width:100px; height:100px; background-color:gold; transition:width 300ms ease,height 300ms ease 300ms,background-color 300ms ease 600ms; } .box:hover{ width:300px; height:300px; background-color:red; } </style> ...... <div class="box"></div>
相关推荐
somboy 2019-12-24
lanzhusiyu 2020-01-11
dazhifu 2019-12-21
wangjie 2019-12-17
walliam 2014-02-10
somboy 2019-11-06
renjianwolai 2018-02-28
haozitwwwcssscn 2018-02-28
Phoebe的学习天地 2020-06-07
needyit 2019-12-08
wangjie 2019-10-25
somboy 2019-10-25
yaodilu 2019-10-11
HLCsweet 2017-09-18
realitycss 2019-07-01
huakaiwuxing 2019-07-01
SuiKaSan的自学室 2019-07-01
qiupu 2019-07-01