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

@keyframes mymove {
  50% {background-position: center;}
}
</style>
</head>
<body>

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

<p>逐渐将背景位置从“左上方”更改为“中心”,然后再改回为“左上方”:<p>
<div id="myDIV"></div>

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

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