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

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.