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

Challenge 2 for the Media Queries Badge on CSS Deep Dive

Howdy.

I'm a little stumped as to why my code is not correct.

Question:

Next, create a new media query that sets the 'body' element's background color to #4682B4 if the viewport width is 480px or less.

Code:

@media screen and (max-width: 768px) {
    body {
        background: #FF6347;
    color: #FFF;
  }

@media screen and (max-width: 480px) {
    body {
        background: #4682B4;
    }

It performs correctly when the view port is resized......, but, I'm getting a fail. Apparently my color is incorrect.

Any thoughts?

2 Answers

  body{
   background-color:#4682B4; 

    }

Using background-color may be the proper way.

Joseph, thanks for replying. I just worked it out though....

I was missing a closing set of curly braces!

Alright! Glad you found your problem.