css中Animation-timing-function速度曲线细节
·

Animation-timing-function:规定动画的速度曲线,默认是“ease”
|
值 |
描述 |
|
Linear |
动画从头到尾的速度是相同的,匀速 |
|
Ease |
默认,动画从低俗开始,然后加快,在结束前变慢 |
|
Ease-in |
动画以低俗开始 |
|
Ease-out |
动画以低俗结束 |
|
Ease-in-out |
动画以低俗开始和结束 |
|
Steps |
指定了时间函数中的间隔数量(步长) |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
div {
overflow: hidden;
font-size: 20px;
width: 0;
height: 30px;
background-color: pink;
/* steps就是分几步来完成我们的动画 有了steps就不要写ease或者linear了 */
animation: w 4s steps(10) forwards;
}
@keyframes w {
0% {
width: 0;
}
100% {
width: 200px;
}
}
</style>
</head>
<body>
<div>某某大学我在这里等你</div>
</body>
</html>
更多推荐




所有评论(0)