Created
December 16, 2011 11:58
-
-
Save danielbrodin/1485793 to your computer and use it in GitHub Desktop.
CSS3 menu
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
/** | |
* CSS3 menu | |
* @danielbrodin | |
*/ | |
html { background: #e8e8e8; } | |
.nav { margin: 50px; padding: 0; } | |
.nav li { list-style: none; float: left; } | |
.nav a { | |
font: 12px sans-serif; | |
color: #444; | |
text-decoration: none; | |
text-shadow: 0 1px 0 #eee; | |
display: block; | |
padding: 10px 15px; | |
border-radius: 2px; | |
border-right: 1px solid rgba(0,0,0,.2); | |
border-left: 1px solid rgba(255,255,255,0.6); | |
background-image: linear-gradient(bottom, #ccc, #ddd); | |
box-shadow: 0 1px 0 #bbb, | |
0 2px 0 #aaa, | |
0 3px 0 #999, | |
0 4px 0 #888, | |
0 5px 0 rgba(255,255,255,0.2), | |
0 6px 6px rgba(0,0,0,0.4); | |
transition: box-shadow 0.2s; | |
} | |
.nav li:first-child a { border-left: none; border-radius: 4px 2px 2px 4px; } | |
.nav li:last-child a { border-right: none; border-radius: 2px 4px 4px 2px; } | |
.nav a:hover { | |
margin-top: 1px; | |
border-left: 1px solid rgba(255,255,255,0); | |
background-image: linear-gradient(bottom, #ccc, #ddd); | |
box-shadow: 0 1px 0 #bbb, | |
0 2px 0 #aaa, | |
0 3px 0 #999, | |
0 4px 0 rgba(255,255,255,0.2), | |
0 4px 6px rgba(0,0,0,0.4); | |
} | |
.nav a.active { | |
color: #666; | |
text-shadow: 0 1px 0 #e8e8e8; | |
border-radius: 0; | |
margin-top: 3px; | |
border-right: 1px solid transparent; | |
border-left: 1px solid rgba(0,0,0,0.1); | |
background-image: linear-gradient(bottom, #c6c6c6, #d6d6d6); | |
box-shadow: 0 1px 0 #bbb, | |
0 2px 0 rgba(255,255,255,0.2), | |
inset 0px 0px 0px rgba(0,0,0,0.1), | |
0 1px 6px rgba(0,0,0,0.3); | |
} |
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> --> | |
<ul class="nav"> | |
<li><a href="#">Menu</a></li> | |
<li><a href="#">Menu</a></li> | |
<li><a href="#">Menu</a></li> | |
<li><a href="#" class="active">Menu</a></li> | |
<li><a href="#">Menu</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
{"page":"result","view":"split"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment