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

Thomas Guppy
Thomas Guppy
3,307 Points

Media Queries. Problem on first challenge

I'm certain I have this right, but its not being accepted:

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

I have entered the color exactly as written above:

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

but i keep getting this message: Bummer! Did you specify the right background color?

Have i done something wrong or is the task faulty?

Looks correct to me. Do you have the link to the question and I will take a look whats going on

Thomas Guppy
Thomas Guppy
3,307 Points

I tried to grab the link, now task one is doing the same thing:

Create a media query that sets the body element's background color to #FF6347 and its text color to white if the viewport width is 768px or less.

My answer:

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

link is: http://teamtreehouse.com/library/css-foundations/media-queries/media-features-and-media-types

3 Answers

I just passed that question with this.

    @media screen and (max-width: 768px) {
      body {
       background: #FF6347;
       color: white;
      }
    }
Thomas Guppy
Thomas Guppy
3,307 Points

Thanks that worked... Strange that i got through the other day with a hexidecimal for the color value.

Are they looking for background-color: #4682B4? Shouldn't make a difference, but they may want something more specific.

Thomas Guppy
Thomas Guppy
3,307 Points

I don't know what changed but I have passed 'task 2' using the exact same code as the other day.

Thanks for the response.