11-animation.html(帧动画)

江枫思渺然 提交于 2020-03-01 19:27:20
<!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>

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!