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

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.