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 trialJason Gaspero
2,372 PointsAdding Breakpoints Code Challenge doesn't seem to be working right
For the first "code challenge" question, it asks, "Create a breakpoint for devices 480 pixels wide or larger. Inside the breakpoint, set the h1 font-size to 2.5em.
So I enter the following code:
@media screen and (min-width: 480px) { h1 { font-size: 2.5em } }
However, when I do this, I get the answer, "Bummer! Did you change the h1 font-size to 2.5em for devices larger than 480px?
I could be wrong here, but isn't this exactly what I did in the above code?
Why is this wrong?
2 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Jason,
You could get that result if you placed your media query at the top. It should be at the bottom so that the existing css doesn't have a chance to override it.
Technically you don't need a semi-colon to end the last or only declaration in a rule but I recommend always including one.
Allison Whitehouse
3,313 PointsI also had the same question, but glad to see that it's been cleared up! Thanks!
Andrea Ward
2,527 PointsAndrea Ward
2,527 PointsThank you! I couldn't get past this either. Since we used the separate file I didn't realize it would need to be at the end.
stephaniecharley
2,230 Pointsstephaniecharley
2,230 PointsI get the first breakpoint code to work for the 480px:
@media screen and (min-width: 480px) { h1 { font-size: 2.5em; }
But when I use the same code with the min-width set to 660px and the font-size set to 1.75em I get, "Bummer! Did you change the h2 font-size to 1.75em for devices larger then 660px?" What am I missing?
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsDid you close off your 480px media query? It looks like you're missing a closing curly brace.