<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.yhd{
width: 100px;
height: 100px;
background: red;
position: relative;
border-radius: 50%;
animation: dh 5s linear 2s running;
}
.yhd:hover{
animation-play-state: paused;
}
@keyframes dh{
0%{background: red;left: 0;}
25%{background:pink; left: 25px;}
50%{background:blue; left: 50px;}
75%{background:orange; left: 75px;}
100%{background:green; left: 100px;}
}
@keyframes dhh{
0%{background: red;left: 0;}
25%{background:pink;left: 25px;}
50%{background:blue;left: 50px;}
75%{background:orange;left: 75px;}
100%{background:green;left: 100px;}
}
.yhd1{
width: 100px;
height: 100px;
background: red;
border-radius: 50%;
position: relative;
animation: dhh 5s linear;
}
</style>
</head>
<body>
演示:1216.mov
<div class="yhd"></div>
<hr />
<div class="yhd1"></div>
</body>