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 Unused CSS Stages Media Queries Media Features and Media Types

snarlzbarkley
snarlzbarkley
2,964 Points

Stuck on Media Query Challenge #1

I am not able to get passed the first challenge in the media query section of CSS.

The question asks you to, "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."

Here is the code I am trying:

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

I have also tried this code using "background-color: #FF6347;" as well as using hex value for the white color (#fff as well as #ffffff) with no success. Can someone spot my error here? Thank you for the help.

1 Answer

nicholas maddren
nicholas maddren
12,793 Points

Here's a clue your missing something here:

@media **** screen *** (max-width: 768px)

Read the question again, if you don't get it I will reveal another clue :)

snarlzbarkley
snarlzbarkley
2,964 Points

Hahaha, thank you! As soon as I saw your post it clicked immediately. I need to learn to stop coding BEFORE my brain is melted and maybe I can avoid some of these simple errors. Thanks again :).