Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Stu Cowley
26,287 PointsHow Can I Create a Hamburger Menu?
Hi everyone,
I'm currently at the stage of a site that I'm building where I need a hamburger menu, and I'm having a tough time on how to actually create one. I have Googled and read many articles and I simply cannot find any resources on how to build a basic one from scratch using CSS, and JavaScript.
Can anyone suggest anywhere where I can find any tutorials and/or articles on how I can create a hamburger menu. I'm surprised this was never actually taught on this site.
Any advice on this would be greatly appreciated!
Thanks
Stu :)
4 Answers
Christopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 PointsHave you done JavaScript and jQuery yet? If not, you can google open source and you will get various examples of code of the hamburger menu which you can fork and use, or learn from. Check codepen you can search for the hamburger menu there and this is what I got: http://codepen.io/search/pens?q=hamburger+menu&limit=all&type=type-pens

Ian Hazelton
6,187 PointsSometimes I'll use FontAwesome if other icons are needed in the project. It's quick and easy. Alternatively, It can be done in pure css. Type codepen+hamburger into google and you'll find thousands of examples. JS is optional i would say.

fngr
11,179 PointsI think you can't do this with CSS alone. You'll need JavaScript or jQuery ;)

Stu Cowley
26,287 PointsWhoops, forgot about JavaScript haha.

Chyno Deluxe
16,935 PointsHere is a quick menu I put together. While when I initially read the post. I thought you meant only creating the hamburger menu icon but readying it again I am assuming you want the menu in its entirety.
Here is a step in the right direction: jsFiddle Demo: Hamburger Menu Icon
While this doesn't include hiding and displaying of the menu itself, it is set up to do so with a little alteration of the javascript to your html and css.
I hope this helps.
Stu Cowley
26,287 PointsStu Cowley
26,287 PointsJust to mention also, I'm looking to display the menu when a user taps on the menu icon. Sorry I didn't add this to my post.
I'll include the code I'm using for my menu.
Just to point out also, this is using the Nav Menu that Guil Hernandez used in the Layout Basics course.