x
 
<!DOCTYPE html>
<html>
<head>
<style> 
#myDIV {
  position: absolute;
  width: 100px;
  height: 100px;
  background-color: coral;
  color: white;
  top: 0;
  animation: mymove 5s infinite;
}
@keyframes mymove {
  50% {top: 300px;}
}
</style>
</head>
<body>
<h1>top 的动画效果:</h1>
<p>逐渐将 top 属性从 0 改为 300px,然后再改回 0:<p>
<div id="myDIV">
  <h1>myDIV</h1>
</div>
<p><b>注释:</b>CSS 动画在 Internet Explorer 9 以及更早版本中不起作用。</p>
</body>
</html>