I am trying to apply a CSS animation to a <span> element and I just can’t get it to work. I can’t find any resource that says whether animations can be applied to <span> elements. So, is it me that is making an error, or are spans animation immune?
Edit: Code
Inf<span class="inf_o">o</span>rmation
<br>
do<span class="don_n">n</span>e
<br>
we<span class="dbl_l">ll</span>
and css:
/* animations */
.inf_o
{
-webkit-animation-name: lower_head;
-webkit-animation-duration: 3s;
-webkit-animation-timing-function:ease-in;
-webkit-animation-delay: 1s;
-webkit-animation-play-state: active;
}
@-webkit-keyframes lower_head
{
from {margin-top:0px;}
to {margin-top:10px;}
}
looks like you have to set a display property. Obviously block will mess up the word, so you need to use inline. I cooked up a jsfiddle for you: http://jsfiddle.net/jdmiller82/XWkRX/1/
As you can see the ‘o’ animates down.