Created
June 11, 2012 02:45
-
-
Save MichaelArestad/2908203 to your computer and use it in GitHub Desktop.
CSS Slider
This file contains hidden or 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
/** | |
* CSS Slider | |
*/ | |
html { | |
min-height: 100%; | |
} | |
body { | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
padding: 5%; | |
} | |
.slider { | |
position: relative; | |
text-align: center; | |
} | |
.slider img { | |
position: absolute; | |
top: 0; | |
left: 0; | |
background: red; | |
width: 100%; | |
-webkit-transition: all 0s 500000s; | |
-moz-transition: background 0s 500000s; | |
-ms-transition: all 0s 500000s; | |
-o-transition: all 0s 500000s; | |
transition: all 0s 500000s; | |
} | |
.slider a { | |
display: inline-block; | |
width: 16px; | |
height: 16px; | |
background: #fff; | |
margin-top: 450px; | |
-webkit-border-radius: 8px; | |
-moz-border-radius: 8px; | |
border-radius: 8px; | |
-webkit-transition: all 0s 500000s; | |
-moz-transition: all 0s 500000s; | |
-ms-transition: all 0s 500000s; | |
-o-transition: all 0s 500000s; | |
transition: all 0s 500000s; | |
} | |
.slider a:active { | |
background: #000; | |
-webkit-transition: all 0s; | |
-moz-transition: all 0s; | |
-ms-transition: all 0s; | |
-o-transition: all 0s; | |
transition: all 0s; | |
} | |
.slider a:active ~ a { | |
background: #fff; | |
border: 2px blue solid; | |
-webkit-transition: all 0s; | |
-moz-transition: all 0s; | |
-ms-transition: all 0s; | |
-o-transition: all 0s; | |
transition: all 0s; | |
} | |
.slider a:active img { | |
z-index: 2; | |
-webkit-transition: all 0s; | |
-moz-transition: all 0s; | |
-ms-transition: all 0s; | |
-o-transition: all 0s; | |
transition: all 0s; | |
} | |
.slider a:active ~ a img { | |
z-index: 1; | |
-webkit-transition: all 0s; | |
-moz-transition: all 0s; | |
-ms-transition: all 0s; | |
-o-transition: all 0s; | |
transition: all 0s; | |
} |
This file contains hidden or 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
<!-- content to be placed inside <body>…</body> --> | |
<div class="slider"> | |
<a href="#" title="The First Slide"><img src="http://www.michaelarestad.com/rolando/img/ampersand.jpg" alt="ampersand" /></a> | |
<a href="#" title="The Second Slide"><img src="http://www.michaelarestad.com/rolando/img/glint.jpg" alt="glint" /></a> | |
<a href="#" title="The Third Slide"><img src="http://www.michaelarestad.com/rolando/img/wigo.jpg" alt="wigo" /></a> | |
</div> |
This file contains hidden or 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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment