Skip to content

Instantly share code, notes, and snippets.

@alegut
Created May 25, 2018 13:58
Show Gist options
  • Save alegut/6450d0b70d28a83d37ee53a09c0d386c to your computer and use it in GitHub Desktop.
Save alegut/6450d0b70d28a83d37ee53a09c0d386c to your computer and use it in GitHub Desktop.
Css slider animate, no controls
<div class="container">
<img class='photo' src="http://farm9.staticflickr.com/8320/8035372009_7075c719d9.jpg" alt="" />
<img class='photo' src="http://farm9.staticflickr.com/8517/8562729616_35b1384aa1.jpg" alt="" />
<img class='photo' src="http://farm9.staticflickr.com/8465/8113424031_72048dd887.jpg" alt="" />
<img class='photo' src="http://farm9.staticflickr.com/8241/8562523343_9bb49b7b7b.jpg" alt="" />
</div>
body {
background: #000;
}
.container {
margin: 50px auto;
width: 500px;
height: 300px;
overflow: hidden;
border: 10px solid;
position: relative;
}
.photo {
position: absolute;
animation: round 16s infinite;
opacity: 0;
}
@keyframes round {
25% {
opacity: 1;
}
40% {
opacity: 0;
}
}
img:nth-child(1) {
animation-delay: 12s;
}
img:nth-child(2) {
animation-delay: 8s;
}
img:nth-child(3) {
animation-delay: 4s;
}
img:nth-child(4) {
animation-delay: 0s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment