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

Jamie Bradley
Jamie Bradley
7,148 Points

CSS: box-sizing: border-box?!

I am on task three of the challenge where I have to make make the extra 40px of padding fit into the total width. Here's my code:

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

I keep getting an error message to recheck my work, but I've looked on the forum, and I don't see where my error is. Help, please!

James Barnett
James Barnett
39,199 Points

Post all of your code, could be a mistake in an earlier step.

2 Answers

Not totally sure, but it could be that you forgot to add in the other webkits

      -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box; 
  box-sizing: border-box;
Neil Salazar
Neil Salazar
5,014 Points

Your code looks right to me, not sure where it is going wrong, maybe showing the rest of the markup may help. Also using the Markdown in your post helps as well.

.main {
  box-sizing: border-box;

This worked when I went back and did the challenge.