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

correct code is shown as incorrect

I have submitted the correct code in the editor for the following challenge:

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

Yet the code checker keeps displaying it as incorrect and I am unable to figure out the mistake.

Here's the code i have used :

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

Steven Parker
Steven Parker
243,644 Points

It would help if you can provide a link to the challenge page.

4 Answers

Steven Parker
Steven Parker
243,644 Points

Now that I've seen the challenge I know that your media query is good in itself. But now since I didn't see the whole code I'm going to take another guess that you did not put your code at the end of the file. It's important to put media queries last so they can take precedence over other rules of the same specificity when they apply.

:point_right: I'll bet that you only need to move your code to the end of the file so it can work correctly.

Steven Parker
Steven Parker
243,644 Points

Without seeing the challenge, I might take a wild guess that they did not intend for you to specify "screen".

thanks a lot steven! it worked!