当前位置: 代码迷 >> 综合 >> 11-animation.html(帧动画)
  详细解决方案

11-animation.html(帧动画)

热度:23   发布时间:2024-01-26 21:14:43.0
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>帧动画</title>
<style type="text/css">#div1 {width: 100px;height: 100px;background: -webkit-radial-gradient(circle, orange, green);background: radial-gradient(circle, orange, green);border-radius: 50%;/* 动画名称,运行时间,无限循环 *//* animation: move 1s infinite; *//* 动画名称,运行时间,运行次数,反方向运行 *//* animation: move 1s 1 reverse; *//* 动画名称,运行时间,运行次数,交替运行 */animation: move 1s 2 alternate;}#div1:hover {/* 鼠标划过时停止 */animation-play-state: paused;}@-webkit-keyframes move {0% {transform: translate(0, 0);}50% {transform: translate(400px, 400px);}100% {transform: translate(400px, 0);}}
</style></head>
<body><div id="div1"></div>
</body>
</html>

 

  相关解决方案