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.

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.