I would like to continuously flash between two different words using CSS. When the first one is visible, the second should not be and vice versa. They should not be visible at the same time (so no fade in/out).
I tried adapting the answers from here and here. But, this is not quite right, because the words are overlapping a lot of the time.
@keyframes blinker {
50% {
opacity: 0;
}
}
.mask{
position:absolute;
-webkit-animation: blinker 140ms infinite;
}
.target{
position:absolute;
-webkit-animation: blinker 240ms infinite;
}
<p class="mask">MASK</p><p class="target">TARGET</p>
Using animation-delay does not work, because it applies the delay to the first presentation, not subsequent iterations. I read this page here but I'm finding it difficult to adapt to two words.
Also, I do not want there to be any delay for the first presentation. The first word has to be visible from the start.