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 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 !