Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

The Box Model

The third challenge is:

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 solution was this:

box-sizing: border-box;

This was the solution provided in the lesson, but it was marked wrong. Can someone tell me why?

4 Answers

Is it possible for you to tell us exactly which challenge it is?

It was the challenge on width, height, and overflow properties, but I have it right now. Thanks.

Dillon Patel
Dillon Patel
4,025 Points

I just completed that and that's the answer I used. Make sure the whole rule is correct.

.main {
     box-sizing: border-box;

I may have left off the .main. I will check. Thanks!

It worked. Thanks again.