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

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

Trying to get the first question right.

@media min-width: 480px{ h1 { font-size: 2.5em; } }

Isn't passing. I also tried doing it like they showed in the video using @media screen and (min-width: 480px) but that doesn't work either.

Austin Whipple
Austin Whipple
29,725 Points

The syntax on your first example is a bit off. Better on the second one.

Check out this existing discussion. That suggests this code should work for that challenge:

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

  h1 {
     font-size: 2.5em;
  }

}

Try different formatting and such and make sure the block is at the bottom of the existing code rather than the top. The code validator can be a bit picky.

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hey Bridger. Welcome to Treehouse.

Your code of

@media (min-width: 480px) {
  h1 {
    font-size: 2.5em;
  }
}

is correct, but I'm guessing that you didn't put it at the end of the CSS file. Because of the Cascading part of CSS, media queries need to be at the end of the CSS file, otherwise it risks being overwritten later on in the file.

Without seeing the entire CSS file, I'm just guessing, but if you delete the media query from the top of the file and put it and the end... you should be good to go.

Keep Coding! :)

Yea. I've been putting my answers at the top, being lazy. Moved it to the bottom and it worked fine.

Thanks guys!