代码示例:(标识:cssref_anim_perspective)
<!DOCTYPE html>
<html>
<head>
<style>
#div1 {
  position: relative;
  margin: auto;
  height: 150px;
  width: 250px;
  padding: 10px;
  border: 1px solid black;
  animation: mymove 5s infinite;
  perspective: 200px;
}

@keyframes mymove {
  50% {perspective: 100px;}
}

#div2 {
  padding: 50px;
  position: absolute;
  border: 1px solid black;
  background-color: red;
  transform: rotateX(45deg);
}
</style>
</head>
<body>

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

<div id="div1">DIV1
  <div id="div2">请想象您正在墙上向下看。看看逐渐改变视角会发生什么!</div>
</div>

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

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