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

Challenge not validating correctly?

The challenge is:

"Challenge Task 3 of 5

Currently, the width of the div with the class main is set to 400px, but the padding applied is adding an extra 40 pixels to its total width. Add a property that forces the padding into the width of the div."

My answer for it is adding box-sizing: border-box;

but that doesn't work, I'm pretty sure it's the box-sizing: border-box property that needs to be added, now I'm stuck and can't proceed..

1 Answer

Alex Heil
Alex Heil
53,547 Points

hey nbil, you're on the right track, that's exactly the property you need. however, I just re-did the challenge and it's validating correctly at my end. perhaps you have a typo or use a wrong selector in your code?

try to compare your current input with this line:

.main {box-sizing: border-box;}

hope that helps and have a nice day ;)

Yep, stupid mistake :D the selector was wrong indeed :) Thanks for pointing that out. Enjoy your weekend.