<div class="textWrapper">
      <p class="text">intro to CSS animations</p>
    </div>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.container {
  width: 100%;
  height: 100vh;
}

.textWrapper {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  padding: 1rem;
  font-size: xx-large;
  background: rgba(255, 240, 240, 0.884);
}

.text {
  color: rgb(98, 98, 98);
  text-transform: uppercase;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  letter-spacing: 0.1rem;
  font-weight: bold;
  animation: translateText 3s linear infinite;
}

@keyframes translateText {
  0% {
    transform: translateX(100%);
  }
  20% {
    transform: translateX(0%);
  }
  25% {
    transform: translateX(10%);
  }
  80% {
    transform: translateX(10%);
  }
  85% {
    transform: translateX(20%);
  }
  100% {
    transform: translateX(-100%);
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.