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

Margin?

What is wrong in the Box model - first code challenge? I use this code and it does not work for the margin...did I make a mistake?

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

3 Answers

James Barnett
James Barnett
39,199 Points

Add a padding of 20px to the top and bottom of the div with the class box. Then, add 40 pixels of padding to the left and right sides.

Your selector isn't using the specified class.

Many thanks!! :)

Thanks but doesnt work - it wants "add a top margin of 50px" to the div...its in the Front end development/CSS/Box model....section....

OK Solved....few steps before I went with div / but should have gove with the class name of the div...THX anyways :)