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!
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 trial

Gabriel E
8,916 PointsNo luck on collapsible menu navbar? Any ideas?
For the last couple weeks, I've been working on the responsive navbar for the mobile side of my site. I'm not that familiar with incorporating Bootstrap, so I'd like to make it with just CSS, HTML, JS or maybe some jQuery as well. My idea is to have a button that I can click, when my media query reaches a certain size, then a sort of semi-translucent menu slides out from the left side. I'd like to create an off-canvas design, so the menu slides out with out moving the body content around. Any suggestions or links would be really appreciated. Thanks, G
1 Answer

Steven Parker
225,742 Points
It sounds like you can do most of what you want just with CSS.
Opacity is a CSS property you can set, and positioning a menu independent of other content can be easily done with the display property set to fixed. The sliding can be done using CSS Transitions and Transforms.
Your button functionality might require a little bit of JavaScript.
Gabriel E
8,916 PointsGabriel E
8,916 PointsThanks a lot for that link! It helped me get on the right path. However, I found a really good blog here: http://medialoot.com/blog/how-to-create-a-responsive-navigation-menu-using-only-css/ I'm doing pretty well on getting the code converted to my own website. However, I've run into a few problems. The "Show Menu" bar stays open when I get to the screen size where it should appear, and it doesn't give me the option to click it to open, it just opens automatically. If you don't mind, could I post my code and you could see if there's any obvious problems that might be causing this? If you feel like looking through it, I'll post the 3 code files below: Thanks!
```RESPONSIVE CSS CODE
@media screen and (max-width: 1060px) {
}