<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    /* https://developer.mozilla.org/zh-CN/docs/Web/CSS/animation */
    .container {
      width: 100px;
      height: 100px;
      background: red;
      animation: run 1s;
      animation-direction: reverse;
      animation-fill-mode: forwards;
      animation-iteration-count: infinite;
      animation-play-state: paused;
    }
    @keyframes run {
      0% {
        width: 100px;
      }
      50% {
        width: 800px;
      }
      100% {
        width: 100px;
      }
    }
  </style>
</head>
<body>
  <div class="container"></div>
</body>
</html>
