CSS CSS Layout CSS Media Queries Complex Media Queries

Sevi Klein
Sevi Klein
5,102 Points

About the last quiz in media queries

I hace stuck in the last quiz and i cant finish the module. This is the question: "Create a media query that changes the background color of the header element to orchid only when the viewport is between 768 and 1024 pixels."

My answer : @media(min-width:768px)and(max-width:1024px) { header{ background-color:orchid; } } And they answer me back: "Bummer: Did you specify the correct background color?" What am i doing wrong? and i cant see it ?? Thank you guys!

2 Answers

Hoi Sevi,

You will need to put a space before and after the logical operator (and) for the query to work properly.

@media (min-width: 768px) and (max-width: 1024px) {
  header {
    background-color: orchid;
  }
}

Happy coding!

Sevi Klein
Sevi Klein
5,102 Points

Yes thank you it worked!

No problem! :)