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 CSS Foundations The Box Model Width, Height and Overflow Properties

Katherine Liu
Katherine Liu
4,668 Points

Overflow css activity question

Hi, this might be a dumb question

but I'm stuck on an activity and the question states: Finally, add an overflow property that automatically provides scrollbars if and where they are needed.

and the error message is:

Bummer! Check the overflow declaration in your CSS.

This is my code

   div[class="main"]{
    box-sizing: border-box;
    max-height:150px;
    overflow:scroll;
   }

I believe I am placing the overflow in the right element because the other rule is a nav element and I tried placing the overflow property there just out of curiosity and it's still wrong. Thanks

1 Answer

Hi Katherine, I think you should use the auto value for the overflow.

 div[class="main"]{
    box-sizing: border-box;
    max-height: 150px;
    overflow: auto;
   }

Because auto will automatically add scroll bars when they're needed.