使用 CSS 设置带有缓慢开始和结束的动画
使用具有ease-in-out值的 animation-timing-function 属性,以使用 CSS 设置动画,使其以缓慢开始和结束的速度运行
示例
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 150px;
height: 200px;
position: relative;
background-color: #808000;
animation-name: myanim;
animation-duration: 2s;
animation-direction: alternate-reverse;
animation-iteration-count: 3;
}
@keyframes myanim {
from {left: 100px;}
to {left: 200px;}
}
#demo {animation-timing-function: ease-out;}
</style>
</head>
<body>
<div id = "demo">ease-in-out effect</div>
</body>
</html>
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP