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 trial

CSS

Jack Fitzgibbon
Jack Fitzgibbon
7,607 Points

Navigation problem.

Hello, When I activate my slide out navigation the body content can be scrolled, I don't want this. I have tried overflow-x: hidden; but for some reason that doesn't seem to work. Any suggestions would be appreciated.

CodePen of page

5 Answers

Jason Brooks
Jason Brooks
1,362 Points

Try this for your wrapper:

.wrapper { max-width: 960px; margin: 0 auto; position: fixed; left: 300px; }

I suppose, properly, it should also have a "top: xxx px;" as well. But this seems to work.

Jason Brooks
Jason Brooks
1,362 Points

Glad to hear it! Although, if the transition is smooth enough, your original was kinda cool.

Shouldn't it be either overflow or overflow-y?

Jack Fitzgibbon
Jack Fitzgibbon
7,607 Points

No, because it allows me to scroll horizontally (x)

I assumed you were referring to the vertical scrollbar. Your (untouched) CodePen doesn't show me a horizontal scroll bar even when the menu is popped out.

Jack Fitzgibbon
Jack Fitzgibbon
7,607 Points

Pedro Cabral, try copying the code into a text editor and viewing it in the browser.

No issues, see here. I added the normalize as well and nothing shows up - tested in Chrome, IE and Firefox - is the content from main.css what you pasted on CodePen?

Jack Fitzgibbon
Jack Fitzgibbon
7,607 Points

Pedro Cabral, I know that no scroll bars appear but it still lets me scroll, doesn't it let you?

Jack Fitzgibbon
Jack Fitzgibbon
7,607 Points

Pedro Cabral, I know that no scroll bars appear but it still lets me scroll, doesn't it let you?