Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKenneth Stanfield
539 PointsSwitching from hamburger in mobile to horizontal navigation in larger screens with media queries
I am trying to figure out how to use media queries to switch from my horizontal navigation (used for large screens), or a hamburger type navigation for mobile screens. Any tips?
5 Answers
eck
43,038 PointsYour media queries will simply need to hide your navigation links and show a hamburger button while at smaller screen widths. This part is fairly simple. But to make it actually work, as in, open and close your menu when you click the hamburger button, you will most likely need to use JavaScript.
If you have no experience with JS, I suggest checking out some tutorials on jQuery, like this one.
Lorraine Wheat
6,083 PointsThis is an awesome tutorial for a mobile friendly menu using only CSS http://webdesign.tutsplus.com/articles/a-simple-responsive-mobile-first-navigation--webdesign-6074
Jordan Davis
7,696 PointsGeat read! definitely recommend reading this article, very insightful!
Cody Craig
10,326 PointsI am not sure what you are aiming to do with it. As Erik said, there are quite a few options that use JavaScript. However, there are some css only options that are worthwhile checking out too. Try searching pure css off canvas menus.
Keith Ostertag
16,619 PointsThanks to Lorraine Wheat for the link to that awesome tutorial!
Piyush Patel
17,253 PointsYeah and I think this can also be achieve with the help of CSS3 translate and display: none properties.
Jacob Mishkin
23,118 PointsJacob Mishkin
23,118 Pointsdo you have any code you are working on, or is this a general question?