<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		.box {
			/* infinite 无限循环
			alternate 逆播  */
			animation: changes 3s infinite alternate;
		}
		/* 百分比是相对动画时长 */
		@keyframes changes {
			0% {
				width: 100px;
				height: 100px;
				background-color: red;
			}
			30% {
				width: 200px;
				height: 400px;
				background-color: blue;
			}
			60% {
				width: 300px;
				height: 600px;
				background-color: skyblue;
			}
			100% {
				width: 600px;
				height: 800px;
				background-color: #ccc;
			}
		}
	</style>
</head>

<body>
	<div class="box"></div>
</body>

</html>

相关文章:

  • 2021-05-18
  • 2021-05-07
  • 2022-12-23
  • 2021-11-29
  • 2021-10-21
  • 2021-06-01
  • 2021-07-23
  • 2021-07-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2021-06-04
  • 2021-12-16
  • 2021-06-25
相关资源
相似解决方案