Last active
December 14, 2015 12:28
-
-
Save jimram/5086135 to your computer and use it in GitHub Desktop.
nav:target - Simple, Semantic, Script free, Accessible Navigation pattern.
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
.jump-link { | |
position: absolute; | |
top:0em; | |
left:0em; | |
width:2em; | |
height:2em; | |
display:block; | |
text-align:center; | |
line-height:2em; | |
background:#333; | |
color:#fff; | |
} | |
.jump-link:hover, | |
.jump-link:focus { | |
background:#c66; | |
text-decoration:none; | |
} | |
.jump-link:after { | |
position:absolute; | |
margin-left:2em; | |
top:0; | |
color:#c66; | |
background:#fff; | |
padding:0 0.5em; | |
display: block; | |
} | |
.jump-link:hover:after { | |
display: none; | |
} | |
#nav-open:before { | |
content:'\2630'; /* Hamburger symbol */ | |
} | |
#nav-open:focus:after { | |
content:'menu'; | |
} | |
#nav-close:before { | |
content:'\2a2f'; /* Multiply symbol */ | |
} | |
#nav-close:focus:after { | |
content:'close'; | |
} | |
#nav-close { | |
display: none; /* hides close button until menu is triggered */ | |
} | |
#main-nav:target #nav-close { | |
display: block; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment