Skip to content

Instantly share code, notes, and snippets.

@perymimon
Last active December 26, 2018 23:02
Show Gist options
  • Save perymimon/7857624 to your computer and use it in GitHub Desktop.
Save perymimon/7857624 to your computer and use it in GitHub Desktop.
<link href="style.css" rel="stylesheet" />
<!-- I am collapsed by default -->
<nav id="main-navigation" class="navigation">
<a href="#">Nav Links</a>
<!-- more -->
</nav>
<!-- I am full width by default -->
<div class="page-wrap">
<header>
<a href="#main-navigation">Menu</a>
<a href="#scrolldown">scroll down</a>
<h1>Title</h1>
</header>
<!-- content -->
</div>
<div class="bottom" id="scrolldown">bottom</div>
.bottom {
position:relative;
top:1000px;
background-color:rgb(10,100,140);
}
.navigation {
/* Collapsed */
overflow: hidden;
position: fixed;
width: 0;
top: 0;
left: 0;
height: 100%;
background-color:red;
}
.page-wrap {
width: 100%;
float: right;
}
.navigation {
transition: width 0.3s ease;
}
#main-navigation:target {
width: 20%;
}
#main-navigation:target + .page-wrap {
width: 80%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment