Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Using animation(CSS) on individual texts in HTML

My HTML is like this

Can someone please tell me why it won’t even budge?

I was expecting each individual text

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

.ending-credit {
  padding-top: 200px;
  text-align: center;
}

.end {
  animation-duration: 4s;
  animation-name: sway;
  animation-iteration-count: infinite;
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(-20deg);
  }
  50% {
    transform: rotate(20deg);
  }
}
<p class="ending-credit">
  <span class="end">I</span>
  <span class="end">w</span>
  <span class="end">i</span>
  <span class="end">l</span>
  <span class="end">l</span>
  <span class="end">r</span>
  <span class="end">e</span>
  <span class="end">t</span>
  <span class="end">u</span>
  <span class="end">r</span>
  <span class="end">n</span> ...
</p>

nested in to do the animation,
but somehow I typed in the wrong code.
Can someone help out?

>Solution :

It’s probably because you can’t simply transform inline elements.
Try setting display: inline-block to the characters’ css.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading