首页htmlbackgroundAnimation - 如何改变动画中的背景颜色

Animation - 如何改变动画中的背景颜色

我们想知道如何改变动画中的背景颜色。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.test {
  width: 200px;
  height: 200px;
  -webkit-animation: play 5s infinite;
}

@-webkit-keyframes play { 
  0% {background: red;}
  24%{background:red;}
  25%{background:green;}
  44%{background:green;}
  45%{background:blue;}
  54%{background:blue;}
  55%{background:orange;}
  74%{background:orange;}
  75%{background:black;}
  99%{background:black;}
  100%{background:white;}
}
</style>
</head>
<body>
  <div class="test"></div>
</body>
</html>