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
Sarah McHarg
3,610 PointsCSS Media Queries: Not accepting 1.4rem
Challenge Task 2 of 2
Next, create a new media query that targets all devices when the viewport width is 768px or narrower. Inside the media query, target the .title element and set the font-size to 1.4rem. Finally, target the h1 element and set its font-size to 5rem.
Bummer! Did you specify the correct font size for '.title'?
What am I missing?
/* Complete the challenge by writing CSS below */
@media (max-width: 1020px) { .main-header { background-color: tomato; color: white; }
@media (max-width: 768px) { .title { font-size: 1.4rem; } .h1 { font-size: 5rem; }
2 Answers
I Dilate
3,983 PointsYou're missing a closing curly bracket on both media queries.
Every bracket you open, you must also close.
Sometimes if you expand it out onto individual lines and indent your code, it will help you see how many you need to close...
@media (max-width: 1020px) {
.main-header {
background-color: tomato;
color: white;
}
}
@media (max-width: 768px) {
.title {
font-size: 1.4rem;
}
.h1 {
font-size: 5rem;
}
}
I Dilate
3,983 PointsI missed the period too! Well done!
And no problem at all.
Good luck with the rest of your track :-)
Sarah McHarg
3,610 PointsSarah McHarg
3,610 PointsYou were right about the brackets, but it also didn't like my '.h1' because it had a period before it. Thank you for your help! :-D