How to run CSS text animation in a sequence. (one line of text after another)

后端 未结 3 1672
被撕碎了的回忆
被撕碎了的回忆 2021-01-03 05:37

I have this fiddle: https://jsfiddle.net/8uwu59sL/ Currently it\'s typing out every line at the same time, but I\'d like to make it type them out one line after another with

3条回答
  •  醉话见心
    2021-01-03 06:29

    So I'll answer your original question first, as it's fairly straightforward with the above setup (which looks really cool, btw). Anyway, you'll want to add the following to each line in order to stagger their animations:

    p:nth-child(2) {
      -webkit-animation-delay: 4s;
      animation-delay: 4s;
    }
    p:nth-child(3) {
      -webkit-animation-delay: 84s;
      animation-delay: 8s;
    }
    

    Basically, just delay the number of seconds required for the line above to finish "typing". I'll look a little further into your question about the blinking rate!

提交回复
热议问题