Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Responsive Web Design and Testing Write CSS Media Queries

Rafael Sanchez
Rafael Sanchez
11,804 Points

Create a breakpoint for devices 480 pixels wide or larger. Inside the breakpoint, set the body background to the color n

navy.....this is the code I wrote @media screen and (min-width 480px){ body{ background: navy; }

Will Macleod
Will Macleod
Courses Plus Student 18,780 Points
@media screen and (min-width: 480px;) {
  body { background: navy;
  }
}

Hi I am having trouble getting through this code challenge with this code I have now, I cant see a problem can anyone help?

Lush Sleutsky
Lush Sleutsky
14,044 Points

Will Macleod

@media screen and (min-width: 480px) {
    body {
      background: navy;
    }
}

You do not need a semicolon after 480px - remove it and all will be well

3 Answers

Maximilian Stöhr
Maximilian Stöhr
7,479 Points

@media screen and (min-width: 480px){ body{ background: navy; } }

Try this, hopefully it will work :)

Adama Sy
Adama Sy
7,076 Points

I will break it for you, you were very close to get it done brother. In your normal css you will write to change you background color of the body tag;

Body { background: navy; }

now you have to do the same but inside your query at a certain witdth. so you set the width of the phone : @media screen and (min-width: 480px){

}

but you have to set the body background inside the phone not inside the computer or the tablet.

so

@media screen and (min-width: 480px){

body { background: navy; }

}

Lush Sleutsky
Lush Sleutsky
14,044 Points

You're missing a closing } to close the media query and that is all.

@media screen and (min-width: 480px) {
    body {
      background: navy;
    }
}