Skip to content

Instantly share code, notes, and snippets.

@C-Rodg
Created May 26, 2016 19:41
Show Gist options
  • Save C-Rodg/943abaad1379faf979e72d0a7f779016 to your computer and use it in GitHub Desktop.
Save C-Rodg/943abaad1379faf979e72d0a7f779016 to your computer and use it in GitHub Desktop.
Off-Screen Navigation
<div id="main-nav" class="nav"><ul><li>OFF SCREEN NAV</li><li>Home</li><li>Contact</li><li>Find Us</li></ul></div>
<div class="content">
<h1>Off Screen Navigation Example</h1>
<h2>This is a dummy example of offcreen navigation</h2>
<p><a href="#main-nav">Click To Open</a></p>
<p><a href="#">Click to Close</a></p></div>
* {
margin: 0;
padding: 0;
}
.nav {
width: 0;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
height: 100%;
background: #000;
color: #ccc;
transition: width .5s ease-in-out;
}
.content {
text-align: center;
width: 100%;
float: right;
background: #ccc;
transition: width .5s ease-in-out;
}
#main-nav:target {
width: 20%;
}
#main-nav:target + .content {
width: 80%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment