I'm trying to learn CSS. I tried to do a simple animation: changing the background color of a span by using keyframes, but nothing change/animate
My code looks like this :
HTML :
<span class="brand1">Test</span>
CSS :
`body{
margin: 0;
padding: 0;}
.brand1{
display: block;
font-size: 2em;
width: 10vw;
-moz-animation: test, 2s, infinite;
animation: test, 2s, infinite;
}
#header{
width: 100%;
background-color: teal;
}
@keyframes test{
from {background-color: tomato; }
to { background-color: violet; }
}
@-moz-keyframes test{
from {background-color: tomato; }
to { background-color: violet; }
}`
I use Mozilla, so I think that there shouldn't be any compatibility issues. So where is the problem in my code?