<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		.box {
			width: 200px;
			height: 200px;
			background-color: red;
			/* animation: change  1s  2s; */
			/* forwards 在动画后 后固定*/
			animation: change1 1s linear forwards,
				change2 1s linear 1s forwards,
				change3 1s linear 2s forwards;
		}

		@keyframes change1 {

			/* 宽200 变成 宽400*/
			from {
				width: 200px;
			}

			to {
				width: 400px;
			}
		}

		@keyframes change2 {

			/*高200 变成 高度400 */
			from {
				width: 400px;
				height: 200px;
			}

			to {
				width: 400px;
				height: 400px;
			}
		}

		@keyframes change3 {

			/*背景色红色 变成 绿色*/
			from {
				width: 400px;
				height: 400px;
				background-color: red;
			}

			to {
				width: 400px;
				height: 400px;
				background-color: green;
			}
		}
	</style>
</head>

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

</html>

相关文章:

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