Last active
June 5, 2016 07:15
-
-
Save chrisdlangton/daa2317d2c5813841d1a7c7a1ab9c38f to your computer and use it in GitHub Desktop.
Image Slider in Pure CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section{ | |
width: 200px; | |
height: 200px; | |
position: relative; | |
left: 50%; | |
top: 1em; | |
margin-left: -100px; | |
overflow: hidden; | |
background: #292929; | |
border: 10px solid #fff; | |
} | |
/*section:hover article{ | |
animation-play-state: paused; | |
}*/ | |
article{ | |
position: absolute; | |
left: 200px; | |
background: #292929; | |
color: #e3e3e3; | |
width: 200px; | |
height: 200px; | |
text-align: center; | |
font: 2em/1em sans-serif; | |
border-box: box-sizing; | |
padding-top: 80px; | |
} | |
article:nth-of-type(1){ | |
animation: slideIn 50s linear 0s infinite; | |
} | |
article:nth-of-type(2){ | |
animation: slideIn 50s linear 5s infinite; | |
} | |
article:nth-of-type(3){ | |
animation: slideIn 50s linear 10s infinite; | |
} | |
@keyframes slideIn{ | |
0% {left: 200px;} | |
1% {left: 0;} | |
10% {left: 0;} | |
11% {left: -200px;} | |
100%{left: -200px;} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section> | |
<article>Slide 1</article> | |
<article>Slide 2</article> | |
<article>Slide 3</article> | |
</section> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment