I'm trying to make an animation of div
that the first 2 seconds appear and position itself in the center of the page and once this animation is finished, it executes a second animation that consists of rotating this div
360 degrees infinitely.
The problem I have is that I do not find or know how to define two types of Animations in the same element (or that one is triggered when the first one is finished).
.bloqueAlargado {
width: 100px;
height: 400px;
background-color: blue;
font-weight: bold;
position: relative;
-webkit-animation-name: mymove2 2s; /*Animacion 1*/
animation-name: mymove2 ;
animation-duration: 2s;
left : 36em;
animation-name: rotacion; /*Animacion 2*/
animation-duration: 4s;
animation-iteration-count: infinite;
}
@-webkit-keyframes mymove2 {
from {left: 0em;}
to {left: 36em;}
}
/* Standard syntax */
@keyframes mymove2 {
from {left: 0em;}
to {left: 36em;}
}
/* Safari 4.0 - 8.0 */
@-webkit-keyframes rotacion {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(-360deg);
}
}
@keyframes rotacion {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(-360deg);
}
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css">
<title>TRANSICIONES</title>
</head>
<body>
<h1 class ="AnimacionBasica">Animacion Basica</h1>
<div class="bloqueAlargado"></div>
</body>
</html>