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

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;
  }
}