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

I keep getting an error on setting a media query breakpoint and adjusting the H1 font size

I've typed in what I think is correct code, but the "challenge reader" keeps saying that I didn't change the H1 font size. I'm confused, I hope someone can help.

4 Answers

Could you post your code copy/pasted? Sometimes the challenges are VERY literal and even one small difference can hold you up.

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

  h1 {
     font-size: 2.5em;
  }

}

That is the code that should work, was the challenge reader EMPTY when you were prompted this? Make sure to put the media queries at the bottom of your CSS, because of the cascading nature of CSS you could be overriding CSS that follows your query.

Hope that helps, thanks.

Thanks for sending the comment about placing it at the end of the code. That's what allowed it to work. I forgot that he said that in the lecture.

Thanks for the response Dale. I don't know what's going on as I initially typed in the same code that you provided. I then took your code and copy and pasted and it's still giving me the bummer error.

The prompt is this:

"Create a breakpoint for devices 480 pixels wide or larger. Inside the breakpoint, set the h1 font-size to 2.5em."

David Wood
David Wood
5,705 Points

Here is what I did and it was accepted...

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

David Wood
David Wood
5,705 Points

Here is what I did and it was accepted...

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