2
I am using this code to make an effect and keep the element in the final position of the animation, ie to the right.
HTML:
<div id="anim">
</div>
CSS code:
#anim{
position: relative;
background: green;
width: 100px;
height: 100px;
}
#anim:hover{
-webkit-animation-name: toRight;
animation-duration: 1s;
}
@-webkit-keyframes toRight{
from {left: 0px;}
to {left: 200px;}
}
@keyframes toRight{
from {left: 0px;}
to {left: 200px;}
}
Very good @re22. But I tried to do with an animation that increased the size of a input, put in the same format right 2s forwards but it didn’t work. Is that for input elements is something different?
– Israel Sousa
I got it, it’s just code of the example you did not put the Animation-Fill-mode: forwards;
– Israel Sousa
I know @re22, I changed the names, but in the same sequence you did Animation: toRight 2s forwards; did not work rsrs.
– Israel Sousa
If you’re in Chrome, you need to use prefix vendor:
-webkit-animation: toRight 2s forwards;
– Renan Gomes
Now yes, it worked that way there.
– Israel Sousa