How can I dynamically change the content of a <span>
tag in an infinite loop.
I have tried using the below method. Is it possible to do this with pure CSS animations? If it is not possible with pure CSS, please suggest an alternate method.
HTML:
<p>Lorem ipsum <span></span> sit amet.</p>
CSS:
span {
content: '';
animation: flip 2s infinite;
}
@keyframes flip {
10% {
content: 'Example no1';
}
40% {
content: '';
}
80% {
content: 'Example no2';
}
100% {
content: '';
}
}
Demo Fiddle
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…