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 The CSS Box Model Concept

leo kamin
leo kamin
5,550 Points

Add a top margin of 50px

It's asking me to set a top margin of 50px I did it and I even tried it in my code editor it worked in the code editor but not on the website. Here's my code I don't think there is anything wrong:

margin-top:50px;

2 Answers

Louis Otto
Louis Otto
23,264 Points

There are bugs people have mentioned, have you tried this? It should pass

div.box {
    padding: 20px 40px; 
    border: 5px solid black;
    margin-top: 50px;
}

Hey there, Leo.

Your code is correct, but perhaps you didn't reference the class?

I don't know if that's an excerpt of your entire CSS code or is all you put, but it should look like.

.box { margin-top:50px; }

Also, the call for adding the margin-top:50px is in task three of that code challenge, perhaps it's because you deleted the code to pass task 1 & 2?

Your entire selector code should look like,

.box { padding: 20px 40px; border:5px solid; margin-top:50px; }