So I have a div
with 3 imagens
<div class="pai">
<img src="1.jpg" />
<img src="2.jpg" />
<img src="3.jpg" />
</div>
I would like these 3 images to run from right to left in order until they reach their positions, and when they do, stop there.
But I wish they would not go out all together. I would like the second to have a time of about 2 seconds after the first one.
Thinking about it, I came up with the idea of using foreach
. But can you implement this in css3
? how?
The template I just made them go into sequence.
Note: NOT I would like to use JavaScript. I want to use CSS only.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Documento sem título</title>
<style>
.pai {
width: 1000px;
height:300px;
position: relative;
overflow: hidden;
}
.pai > img {
width: 10%;
position:relative;
animation: animacao 5s;
animation-delay: 3s;
animation-direction: alternate;
}
@keyframes animacao{
0% {left: 110%; top: 0px;}
100% {left: 0px; top: 0px;}
}
</style>
</head>
<body>
<div class="pai">
<img src="1.jpg">
<img src="2.jpg">
<img src="3.jpg">
</div>
</body>
</html>