L
L
Leonid Gorshkov2018-06-26 19:28:33
css
Leonid Gorshkov, 2018-06-26 19:28:33

CSS animation not working?

#load {
            position: absolute;
            
         }
         #load > B {
            color: red;
            animation: nev 1s infinite alternate;
         }
         
         @keyframes nev {
           0%  {
           transform: rotateY(0deg);
           }

           100% {
            transform: rotateY(-360deg);
           }
         }

<div id="load">
         <b>S</b>ynacs
      </div>

An animation is written in css for the first character in the tag . It is also written there that it will be red (this symbol).
As a result, the symbol is red (as it should be), but the animation does not spin!
if you change the css to something like this:
#load {
            position: absolute;
            animation: nev 1s infinite alternate;
         }
         #load > b {
            color: red;
         }
         
         @keyframes nev {
           0%  {
            transform: rotateY(0deg);
           }

           100% {
            transform: rotateY(-360deg);
           }
         }

That all works. What is the reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yakupov112, 2018-06-26
@Synacs-U

https://codepen.io/anon/pen/vrzQmO

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question