<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
/* 先定义动画 */
@keyframes move {
from {
transform: translate(0, 0);
}
to {
transform: translate(1000px, 0);
}
}
div {
width: 200px;
height: 200px;
background-color: pink;
/* 调用动画 的名称 */
animation-name: move;
/* 调用动画的时间 */
animation-duration: 1s;
}
</style>
</head>
<body>
<div></div>
</body>
</html>
动画的基本使用
猜你喜欢
转载自blog.csdn.net/weixin_42378409/article/details/104943481
今日推荐
周排行