代码示例:(标识:cssref_anim_background-size)
<!DOCTYPE html>
<html>
<head>
<style> 
#myDIV {
  width: 300px;
  height: 200px;
  border: 1px solid black;
  background-image: url('/static/demo/images/logo-1.png');
  background-size: 20px 20px;
  animation: mymove 5s infinite;
}

@keyframes mymove {
  50% {background-size: 125px 125px;}
}
</style>
</head>
<body>

<h1>background-size 的动画效果:</h1>

<p>逐渐将背景尺寸从“10px 10px”更改为“125px 125px”,然后再改回:<p>
<div id="myDIV"></div>

<p><b>注释:</b>CSS 动画在 Internet Explorer 9 以及更早版本中不起作用。</p>

</body>
</html>
运行结果: