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 CSS - Beyond the Basics Working with Media Queries Media Features and Media Types Challenge

Jana Beals
Jana Beals
3,647 Points

Finally, create a new media query that sets the width of .wrap to 700px if the viewport is 800px or wider.

What is wrong with what I have entered?

style.css
/* Complete the challenge by writing CSS below */
@media screen and (max-width: 768px) {
  body {
    background: #FF6347;
    color: #FFF;
  }
}

@media screen and (max-width: 480px) {
  body {
  background: #4682B4;
  }
@media screen and (min-width: 800px) { 
  .wrap { 
    width: 700px; 
  } 
}
index.html
<!DOCTYPE html>
<html>
<head>
    <title>Media Queries</title>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="wrap">
        <h1>Hi There!</h1>
        <p>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi lectus ante, luctus vel euismod ut, suscipit quis ligula. Vestibulum augue ante, semper sit amet congue non, faucibus sit amet lacus.
        </p>
        <p>
            Maecenas lobortis porttitor nisi, quis congue neque porta at. Donec interdum arcu eu ante semper nec venenatis ipsum dignissim. Vestibulum ultricies mi quis lectus suscipit fermentum.
        </p>
    </div

3 Answers

You're really close, the error appears to be related to the fact that you did not add a closing bracket to the media query above it. Once you add that it should pass.

/* Complete the challenge by writing CSS below */
@media screen and (max-width: 768px) {
 body {
   background-color: #ff6347;
   color: #fff;
 }
}

@media screen and (max-width: 480px) {
 body {
  background-color: #4682b4; 
 }
}

@media screen and (min-width: 800px) {
 .wrap {
  width: 700px; 
 }
}
Pavle Lucic
Pavle Lucic
10,801 Points

Close bracket on

@media (max-widht:480) { 

//code
//code

**
}  missing
**

Glad it helped Jana. Just as a heads up it's encouraged that you select Best Answer for the response that helped you resolve your challenge. It rewards the member who answered with some points and lets others know there is a definite answer within the post in case they are facing a similar issue.