Let's get started with a Web Site Hamburger Navigation Menu!
- Open Notepad++
- Open your
index.html
file
- Open your
styles.css
file
- Click: New -> File
- Click: Save
- Name that file: menu.html
- Click: Save
- Copy the Hamburger Menu Page Template (HTML) code (below)
- Paste that code into your
menu.html
file.
- In your
index.html
file:
- Add a link to this page.
Change: <li>Create Menu Navigation Page</li>
to: <li><a href="menu.html">Create Site Navigation Page</a></li>
- Save your changes
- Click: Run
- Choose: Launch in IE
or Launch in Chrome
or Launch in Firefox
- View your web page
- Make any changes
- Save your changes
<doctype html>
<html>
<head>
<title>page title goes here</title>
<!-- put your name in this comment line -->
<link href="includes/styles.css" rel="stylesheet"/>
<style>
#icon span {
border-bottom: 2px solid black;
display: block;
height: 5px;
width: 25px;
}
#menu {
display: none;
}
#menu a {
font-size: 24px;
text-decoration: none;
}
</style>
<script>
function showHide() {
var links = document.getElementById('menu');
if (links.style.display === "block") {
links.style.display='none';
} else {
links.style.display='block';
}
}
</script>
</head>
<body>
<h2>My Hamburger Menu Page</h2>
<div id="icon" onclick="showHide();">
<span></span>
<span></span>
<span></span>
</div>
<div id="menu">
<a href="divs.html">Divs</a><br />
<a href="grid.html">Grid</a><br />
<a href="hamburger_menu.html">Menu</a>
</div>
</body>
</html>
HTML Hamburger Menu Navigation Template
Example