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 trialBarry Schutte
Front End Web Development Techdegree Student 1,954 PointsHide scrollbar.
Hi,
My box looks exactly the same as yours. Everything in CSS is also the same. The only thing is my scrollbar doesnt hide when I don't use it. How can I fix this? My overflow is also on auto. I already tried the other overflow settings.
3 Answers
Cosimo Scarpa
14,047 PointsIf you want to hide the scroll bar you should use this:
body {
overflow: hidden;
}
This is to hide just the horizontal
body {
overflow-x: hidden;
}
This is to hide just the vertical
body {
overflow-y: hidden;
}
Barry Schutte
Front End Web Development Techdegree Student 1,954 PointsOh I tought that my question would appear under the video. It was the CSS Boxmodel workshop.
This is the code:
.box { width: 90%; height: 300px; max-width: 600px; padding: 20px; border: 2px solid black; margin: auto; overflow: auto; box-sizing: border-box; }
Barry Schutte
Front End Web Development Techdegree Student 1,954 PointsThank you. But then it doesn't appear anymore when needed, like in the video.
Aurelian Spodarec
10,801 PointsAurelian Spodarec
10,801 PointsWe can't tell without seeing the code :)