<div></div>
div::before {
  content: '';
  animation: flip 6s linear infinite;
}

@keyframes flip {
  from { content: 'Hello!'; }
  to { content: 'Goodbye!'; }
}

/* everything below is for demo appearances and not important to the concept */

body {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  color: #fe4365;
  background-image: linear-gradient(45deg, #c5e0dc, #f9cdad);
  font: 700 5rem/1 'Signika', sans-serif;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.