Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


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
216,136 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!