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 :).