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

Daniel Stakeley
Daniel Stakeley
10,611 Points

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.

Daniel Gregg
Daniel Gregg
1,444 Points

Thank you this also helped me! :)