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

Top Margin help needed

The challenge asks to add a top margin of 50px. This is what I typed and it says I am wrong for the margin but correct for everything else. What do I need to change?

div{ padding:20px 40px; border-width:5px; border-style:solid; margin-top:50px;

}

Can you copy the entire question here? There might be something else in it that you missed.

3 Answers

It was the last part of a challenge. For the last part the only instructions were to add a top margin of 50px

The link to the question enables us to try it for ourselves get the correct answer and then guide you too it. Without this is hard to know why it is failing for you.

Thanks

I just passed it two different ways. But have just noticed your code above has "div" instead of ".box" before the rules. Here is what I had

First Way

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

Second Way

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

Hope this helps

Thanks! Got it!