Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,567 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 :)