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

Calvin Maighan
Calvin Maighan
12,061 Points

The CSS Box Model Concept: Challenge Error

I've been reviewing the challenges and quizes in the CSS section, but this particular objective is saying I have the wrong answer, when I'm pretty sure its the right one. Even the preview is doing what I want it to. It's a simple margin-top that I'm adding but it tells me to check my CSS.

Here is a screenshot: http://prntscr.com/2hp7i6

Guil Hernandez
Guil Hernandez
Treehouse Teacher

Hi Calvin Maighan,

I looks like it didn't validate the top margin because the challenge asks you to target the .box class. You used div as the selector – looks like it worked for the previous tasks, but specifying the right selector is important in code challenges. :)

Calvin Maighan
Calvin Maighan
12,061 Points

Oh ok thanks a lot, that makes sense, just it was difficult to trouble shoot knowing it worked on previous ones :)

3 Answers

Wayne Priestley
Wayne Priestley
19,579 Points

Sometimes it may just be a gremlin, try logging out then back in. Sometimes the only option it to leave it for a while then return and it just works.

I seen this happen to a few people and experienced it myself. Its really annoying when it happens but i haven't seen any way to fix it apart from what I've already mentioned.

Make sure you retype the code in full and don't paste it in, that sometimes seems to cause an issue,

Yep this looks correct.

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

For the sake of moving on you could try the same as shorthand and see if it works:

div {
  padding: 20px 40px;
  border: 5px solid;
  margin: 50px 0 0 0;
}
Calvin Maighan
Calvin Maighan
12,061 Points

Well I've personally completed it already, a while ago, it was just for review so its not like I need the point. Just thought that if it was happening to others too I might point it out since I know the site has been changing a lot recently :)