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

CSS course task question

Task is: : Next, create a new media query that targets all devices when the viewport width is Task768px 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.

Here's the error message: Bummer! Did you specify the correct font size for '.title'?

Here's my code: @media (max-width: 768px) .title {font-size: 1.4rem;} .h1 {font-size: 5rem;}

Please let me know what I am doing wrong. Thanks for your help.

Jim Gravitt 502-896-0231

4 Answers

Steven Parker
Steven Parker
229,732 Points

:point_right: It looks like you forgot the braces for the media query itself:

@media (max-width: 768px) {
  .title { font-size: 1.4rem; }
  .h1 { font-size: 5rem; }
}

In future postings, remember to include a link to the challenge page.

Also, you might want to edit out your phone number above to prevent spammers from getting it.

Thanks but that didn't get the job done. The current error message is Bummer! Did you specify the correct font size for the h1? Here is my code:

@media (max-width: 768px) { .title { font-size: 1.4rem; } .h1 { font-size: 5rem; } }

Thanks for any help you can provide. Feel free to give me a call at 502-896-0231. I'll take the risk that a spammer might take the number, thanks for the warning though.

@media (max-width: 768px) {
  .title {
    font-size: 1.4rem; 
}
 h1 { 
    font-size: 5rem; 
   }
}

remove(.) before h1

Thanks so much Pranay. That worked!