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
Hamed Ali
5,626 PointsChallenge Task: Add Breakpoint for Devices
The Task assignment in "How to Make a Website Course" is:
Create a breakpoint for devices 480 pixels wide or larger. Inside the breakpoint, set the h1 font-size to 2.5em.
It wont accept my answer. I think I am doing the same thing the trainer did. Does anyone see a bug in my response:
'''CSS
@media screen and (min-width: 480px) {
h1 {
font-size: 2.5em;
}
}
'''
3 Answers
Trevor Johnson
14,427 PointsPut it at the bottom of your CSS file
Hamed Ali
5,626 Pointsahh bingo!!! placing it at the bottom of the file worked.
I kept the "screen and" portion
thx Trevor
Trevor Johnson
14,427 PointsHi Hamed, your code should look like this.
@media (min-width: 480px) {
h1 {
font-size: 2.5em;
}
}
Trevor Johnson
14,427 PointsThe problem was that your syntax was just slightly off. You don't need "screen and". You also need to use a colon after font-size to specify the font. so font-size: 2.5em; instead of font-size; 2.5em; The semicolon is like a period so when you use it after font-size it doesn't interpret the 2.5em with it.
Hamed Ali
5,626 PointsHi Trevor,
Thx for the quick response. Yeah thats exactly what I had - but I had added the "... screen and ... " text.
I even tried to copy and past your's but it still rejects it with this error message:
"Bummer! Did you change the h1 font-size to 2.5em for devices larger than 480px?"
Trevor Johnson
14,427 PointsTrevor Johnson
14,427 PointsThe reason is that it is reading your file from top to bottom, and if you have the media query before everything else that it is referencing it won't be able to execute what you want it to.