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

Joshua Wolfe
Joshua Wolfe
1,897 Points

Media Queries Question: Im following code exactly as the prof types and its not working, what am I missing?

2 Answers

Andrew Fennell
Andrew Fennell
1,413 Points

Hey there Joshua! I think I have the fix for you...

In your first media query you have the keyword "all" which is not necessary. Go ahead and remove that and all should work fine. Also, go ahead and change the "color" attribute in your third media query to be "background".

Your final media query section should look like this:

/* Media Queries -------------------- */

@media (max-width: 960px) {
  body {
    background: royalblue;
  } 
}

@media (max-width: 480px) {
  body {
    background: darkred;
  }
}

@media (min-width: 481px) and (max-width: 700px) {
  body {
    background: seagreen;
  }
  p {
    background: white;
  }
}