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 trialStephen Hancock
4,888 PointsI cant seem to pass the q about adding scrollbar if and where needed.
I tried to add overflow: scroll to the div .main, the html and the body and it keeps asking me to check my overflow declaration. Any help?
/* Complete the challenge by writing CSS below */
a { display: inline-block; width: 100px; }
.main { box-sizing: border-box; max-height: 150px; overflow: scroll; }
2 Answers
Milan Milosevic
6,647 PointsHello Stephen.
The answer to this is : overflow: auto;
because it says the scroll bar should be there only if needed ;)
- scroll : The overflow is clipped, but a scroll-bar is added to see the rest of the content
2.auto : If overflow is clipped, a scroll-bar should be added to see the rest of the content
Garrett Sanderson
12,735 PointsHi Stephen,
Because the question says it will want the scroll if and when they are needed then the scroll won't be there all the time which is what you are declaring with:
overflow: scroll;
Instead of scroll you need to use a different rule. This is just a hint. Does that help?