Created
May 31, 2017 15:30
-
-
Save ConnerAiken/a0c43261188b96d959adcdf2979bdd47 to your computer and use it in GitHub Desktop.
Very basic hamburger menu example
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Bootstrap Example</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> | |
<style> | |
.sidebar { | |
background-color: black; | |
width: 150px; | |
position: absolute; | |
top: 0; | |
left: 0; | |
bottom: 0; | |
} | |
.sidebar h1 { | |
color: white; | |
} | |
.portfolio { | |
background-color: red; | |
position: absolute; | |
top: 0; | |
left: 150px; | |
right: 0; | |
bottom: 0; | |
-moz-transition: left 0.5s ease; | |
transition: left 0.5s ease; | |
} | |
input[type=checkbox] { | |
display: none; | |
} | |
input:checked~.portfolio { | |
left: 2.5%; | |
} | |
input:checked~label { | |
left: 2.5%; | |
} | |
label { | |
z-index: 2; | |
position: absolute; | |
top: 0; | |
left: 150px; | |
background-color: blue; | |
-moz-transition: left 0.5s ease; | |
transition: left 0.5s ease; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="main-wrap"> | |
<input id="slide-sidebar" type="checkbox" role="button" /> | |
<label for="slide-sidebar"><span>close</span></label> | |
<div class="sidebar" style="text-align: center;"> | |
<h1>Menu</h1> | |
<a href="#" style="border-top:1px solid grey;display:block;"> | |
Nav Link #1 | |
</a> | |
<a href="#" style="border-top:1px solid grey;display:block;"> | |
Nav Link #2 | |
</a> | |
</div> | |
<div class="portfolio"> | |
<h1>My Portfolio</h1></div> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment