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

Naomi Freier
Naomi Freier
3,627 Points

i'm trying to make my website responsive using media queries and it's not working. what am I doing wrong?

this is my code:

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

  body {
    background-color: blue;
  }
}

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

  body {
    background-color: orange;
  }
}

this is what I put into the html:

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

this is in head, underneath all other css file links.

4 Answers

It looks like a typo:

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

It should be stylesheet

Ian Suy
Ian Suy
6,706 Points

Nice catch! I do that all the time.

Ian Suy
Ian Suy
6,706 Points

I think you want to use max-width.

Corwyn Wilkey
Corwyn Wilkey
7,971 Points

Do you have this meta tag included in the head?

<meta name="viewport" content="width=device-width, initial-scale=1">
Corwyn Wilkey
Corwyn Wilkey
7,971 Points

Oh, yep... Good eye @David Bilson! There is a typo in the link. @Naomi Frier, you put "sytlesheet" instead of "stylesheet".