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!

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

HTML How to Make a Website Responsive Web Design and Testing Adding Breakpoints for Devices

Can't get the background color to change.

1 I created responsive.css and added to css folder.

2 Added to head below main.css

<link rel="stylesheet" href="css/responsive.css">

3 Added code to responsive.css

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

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

I tried refreshing the browser.

1 Answer

Mircea Ungureanu
Mircea Ungureanu
7,483 Points

Hello, you forgot to put ":" in the @media screen and (min-width 480px) at the end of "min-width". Ex: @media screen and (min-width: 480px) Hope it helps.


Thank you this also helped me! :)