JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<p class='css-typing x1'>To save their world</p>
<p class='css-typing x2'>They must come to ours</p>
<p class='css-typing x3'>Spongebob out of water</p>
</div>
CSS
.container {position:relative;}
.css-typing {
width: 10em;
white-space: nowrap;
overflow: hidden;
opacity:0;
position:absolute;
top:0;
left:0;
}
.x1 {animation: type1 5s steps(50, end);}
@keyframes type1 {
0% {width: 0; opacity:1}
99% {width: 10em; opacity:1}
100% {opacity:0;}
}
.x2 {
animation: type2 5s steps(50, end);
animation-delay:5s;
}
@keyframes type2 {
0% {width: 0; opacity:1}
99% {width: 10em; opacity:1}
100% {opacity:0;}
}
.x3 {
animation: type3 5s steps(50, end);
animation-delay:10s;
}
@keyframes type3 {
0% {width: 0; opacity:1}
99% {width: 10em; opacity:1}
100% {opacity:0;}
}