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 How to Make a Website Responsive Web Design and Testing Write CSS Media Queries

Robin Malhotra
Robin Malhotra
14,883 Points

Code challenge not working

I've added the correct CSS code(IMHO) to the editor. The preview output looks about right.

3 Answers

Sorry it took so long to reply, I hope you were able to figure it out. If not, your issue is that you've included a colon between @media and screen that shouldn't be there.

So your code should look like this:

@media screen and (min-width: 480px) {
  body {
    background-color:navy;
   } 
}

Could you post your code? It may look right to you, but it's always great to get a fresh set of eyes to spot any typo's or mistakes you might have made. It's amazing what the tiniest mistake will do to break the code.

Robin Malhotra
Robin Malhotra
14,883 Points

I simply added a media query

@media:screen and(min-width:480px) { body{background-color:navy;} }

Here's a screenshot

https://www.dropbox.com/s/0bbous0lq5nzufp/Screen%20Shot%202014-05-22%20at%204.09.06%20am.png

Robin Malhotra
Robin Malhotra
14,883 Points

Got it. Thanks a lot. But then how'd the background color change? Was the preview being "forgiving" as Nick Pettit said?

It was probably doing just that, I've encountered issues with the preview too :)