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.

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

Breakpoint

When i taking the task

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

The written the code on the workspace

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

But its Did you change the background color to navy for devices larger than 480px?

where did i go wrong?

2 Answers

<style>
@media screen and (min-width:480px) { // These brackets should contain css styles.

// They will be applied if the condition is met

// Select an element within the media query. 

 }

// Media queries do not work like below ( There is nothing selected either ):

@media screen and (min-width:1280px){ color: white; }

@media screen and (min-width:780px){ color: blue; }

@media screen and (min-width:480px){ color: red; }  
</style>

Thanks for help Leonardo , I figure out

As I forgot to give selectors in breakpoint

<style>
@media screen and (max-widht: 480px)
 {
   body{
   background:navy;
   }
}

</style>

Thanks for help Leonardo , I figure out

As I forgot to give selectors in breakpoint

<style>
@media screen and (max-widht: 480px)
 {
   body{
   background:navy;
   }
}

</style>

Ty, Nice work !