代码示例:(标识:cssref_anim_transform)
<!DOCTYPE html>
<html>
<head>
<style> 
#myDIV {
  margin: auto;
  border: 1px solid black;
  width: 200px;
  height: 100px;
  background-color: coral;
  color: white;
  animation: mymove 5s infinite;
}

@keyframes mymove {
  50% {transform: rotate(180deg);}
}
</style>
</head>
<body>

<h1>transform 的动画效果:</h1>

<p>逐渐将 div 元素旋转 180 度,然后转回来:<p>

<div id="myDIV">
  <h1>myDIV</h1>
</div>

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

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