+ 2
How do i move the whole bullet using animation
13 Respuestas
+ 6
Code master Joaquin Nievas
You forgot or missed to put curly braces {} after 0% and 100%. That's why it won't move.
Do it like this:
@keyframes bullet {
0% {transform: translate(0px , 0px)}
100% {transform:translate(300px , 0px)}
}
But this will automatically animate. If you want to animate it after clicking, use JavaScript.
PS: Mark this as best answer if you think this helps you.
+ 2
transform: translate (90px , 0px)
+ 2
if you want to move them to the end of the page you could use:
@keyframes
0% transform : translate (0px , 0px)
100%transform:translate(100% , 0%)
+ 2
i want to move it from the start position to 300px to the right
+ 2
if i click on the bullet it should move 300px to the bullet and the bullet is made of two parts
+ 2
Code master Your animations still don't work because the word "transform:" is outside the curly braces. You should put it inside this "{".
+ 1
i dont want to rotate the bullet i want to move it horizontally
+ 1
hey joaquin im sorry the question is wrong i want to transition it
+ 1
you can do it with JavaScript . the function is called onclick event . search onclick event in a web page called w3schools
0
transition it?
0
where do you want to move it?
0
@keyframes bullet
0% transform: translate(0px , 0px)
100%transform:translate(300px , 0px)
0
can I somehow merge my bullet1 and bullet2 div