<html>
  <head>
    <title>CSS animation</title>
  </head>
  <body>
    <div class="page">
      <div class="example-item"> 
        <p class="example-item__text">Простой пример использования CSS свойства <code>animation</code> совместно с правилом <code>@keyframes</code>:</p>
        <div class="example-item__content">
          <div class="example-item__block example-item__block--bounce"></div>
        </div>
      </div>
      <div class="page__copyright">
         Пример использования свойства <a class="page__copyright-link" href="https://tuhub.ru/refs/css/animation" target="blank">animation в CSS</a>
      </div>
    </div>
  </body>
</html>
@keyframes bounce {
  0% {
    margin-left: 0;
  }
  100% {
    margin-left: 50%;
  }
}

.example-item__block--bounce {
  animation: bounce 1.5s alternate infinite ease-in;
  width: 50px;
  height: 50px;
  background-color: red;
  border-radius: 3px;
}

External CSS

  1. https://tuhub.ru/themes/custom/tuhub/dist/css/codepen.css

External JavaScript

This Pen doesn't use any external JavaScript resources.