css 3 过渡
=====================================================================================
过渡---一个元素在不同状态之间进行平滑的转换,CSS 3 中使用transition属性实现过渡效果。
transition :过渡属性 执行时间 时间函数 延时时间;
立即学习“前端免费学习笔记(深入)”;
时间函数---设置元素运动的速度
(1)贝塞尔曲线 cubic-bezier(p1(x,y),p2(x,y))
预定义贝塞尔曲线:
ease(默认值)
linear
ease-in
ease-out
ease-in-out
(2) steps()
step-start //步数为一
step-end
=======================================================================================================================================================================================
示例一:
img:hover{ transform: translate(600px);}img{ transition:2s cubic-bezier(0.6,0.1,0.1,0.7);}
示例二:
<style> div:hover img{ transform:translate(300px); } .i01{ transition:2s steps(3,start); } .i02{ transition:2s steps(3,end); } .i03{ transition:2s linear; } </style>
<div> @@##@@<br/> @@##@@<br/> @@##@@ </div>
===========transition属性的每一步都可以用单独的属性表示
transition: all 2s linear 3s;
transition-property: all; transition-duration: 2s; transition-timing-function: linear; transition-delay: 3s;
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号