Created
February 8, 2013 03:21
-
-
Save digitalnature/4736353 to your computer and use it in GitHub Desktop.
playing around with:
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
/* playing around with: | |
http://stackoverflow.com/questions/14761316/advanced-css-rollover-parent-container-image-swap | |
*/ | |
body{ | |
font: normal normal 16px/18px "Lucida Grade", Calibri; | |
} | |
ul, li{ | |
margin: 0; | |
padding: 0; | |
list-style-type: none; | |
} | |
ul{ | |
overflow: hidden; | |
} | |
li{ | |
float: left; | |
position: relative; | |
z-index: 4; | |
height: 40px; | |
background: #eee; | |
background: linear-gradient(0deg, #ddd, #eee); | |
} | |
li:hover{ | |
background: #999; | |
background: linear-gradient(0deg, #666, #999); | |
} | |
li:first-child{ | |
border-radius: 4px 0 0 4px; | |
z-index: 10; | |
} | |
/* each list item overlaps the next */ | |
li:nth-child(2){ z-index: 9; } | |
li:nth-child(3){ z-index: 8; } | |
li:nth-child(4){ z-index: 7; } | |
li:nth-child(5){ z-index: 6; } | |
li:nth-child(6){ z-index: 5; } | |
li:nth-child(7){ z-index: 4; } | |
li:nth-child(8){ z-index: 3; } | |
li:nth-child(9){ z-index: 2; } | |
li:last-child{ | |
background: #f6f6f6; | |
background: linear-gradient(0deg, #eee, #f6f6f6); | |
} | |
a::after{ | |
content: ''; | |
position: absolute; | |
z-index: 5; | |
top: 2px; | |
right: -15px; | |
width: 30px; | |
height: 40px; | |
background: #eee; | |
background: linear-gradient(-45deg, #ddd, #eee); | |
transform: rotate(45deg) skew(14deg, 14deg); | |
border: 5px solid #fff; | |
border-bottom: 0; | |
border-left: 0; | |
} | |
li:hover a::after{ | |
background: #999; | |
background: linear-gradient(-45deg, #666, #999); | |
} | |
a{ | |
display: block; | |
padding: 10px 20px 12px 40px; | |
color: #666; | |
text-shadow: 0 1px 0 #eee; | |
text-decoration: none; | |
text-transform: uppercase; | |
} | |
li:first-child a{ | |
padding-left: 20px; | |
} | |
li:hover a{ | |
color: #fff; | |
text-shadow: 0 -1px #000; | |
} | |
li:last-child a, | |
li:hover:last-child a{ | |
color: #aaa; | |
text-shadow: 0 1px 0 #fcfcfc; | |
} | |
li:last-child a::after{ | |
background: #f6f6f6; | |
background: linear-gradient(-45deg, #eee, #f6f6f6); | |
} |
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
<ul> | |
<li> <a href="#">Home</a> </li> | |
<li> <a href="#">Inner page</a> </li> | |
<li> <a href="#">Really loooooooong inner page</a> </li> | |
<li> <a href="#">Fourth</a> </li> | |
<li> <a>Last</a> </li> | |
</ul> | |
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
// alert('Hello world!'); |
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","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment