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

Darryn Smith
Darryn Smith
32,043 Points

CSS: "Add a top margin of 50px (to the <div> element)"

would this not be:

div { margin-top: 50px; }


2 Answers

Dave McFarland
Dave McFarland
Treehouse Teacher

You are supposed to add this to the style you've been creating in the challenge. It uses a class selector .box

.box {
  padding: 20px 40px; 
  border-width: 5px;
  border-style: solid;
  margin-top: 50px;
Darryn Smith
Darryn Smith
32,043 Points

Yeah, thanks.

I hadn't mentioned or specified '.box' class requirement within the scope of my question, but I did actually use the margin-top parameter within the .box class in the challenge.

With nothing else to do as I waited, I reloaded the page and started the test over. I had copied my previous work and re-pasted it, unmodified, into the re-loaded challenge. And this time it passed.

So... who knows...

But I sincerely appreciate the replies. Someday (probably very soon) it'll be something I'm actually getting wrong. :)