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

Rob Kramers
Rob Kramers
12,732 Points

Stuck at last objective of Media Queries

Its asking me to do this :

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.

And i made :

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

h1 { font-size: 5rem; } }

But its wrong but i cant seem to find out why? This is the response i get : Bummer: Did you specify the correct font size for '.title'? Wich im sure i did. So im kinda lost Anyone knows what im doing wrong here? Thansk for reading and helping out!

Cameron Childres
Cameron Childres
11,818 Points

Is the code you posted definitely exactly what you submitted? I've just reattempted the exercise with what appears to match your submission and it was accepted:

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

5 Answers

Rob Kramers
Rob Kramers
12,732 Points

Yes thats literally what it submitted and i keep getting the same error. Even with the code you posted. Really weird.

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

Are you including all the code from any previous part of the code challenge as well?

I've found the code challenge you're referring to. You need to make sure the selectors for both parts are in the code when you submit for task 2.

Rob Kramers
Rob Kramers
12,732 Points

@media (max-width: 1020px) { .main-header { background-color: tomato; color: white; } @media (max-width: 768px) { .title { font-size: 1.4rem; } h1 { font-size: 5rem; } }

Yes this is what im posting. Is there any way i can include screenshots here? Then i could show you

Cameron Childres
Cameron Childres
11,818 Points

You're missing the closing curly brace for your first media query

Rob Kramers
Rob Kramers
12,732 Points

Ive deleted my cookies tried it on my girlfriends laptop and im still getting the same error. Im really clueless on whats happening. Thanks for your response :)

Rob Kramers
Rob Kramers
12,732 Points

Thanks!!!!!!!!!!!!!!!!!! I can continue my journey on Treehouse!

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Just try putting your h1 selector inside your media query and I think that should sort you out. :-)

Rob Kramers
Rob Kramers
12,732 Points

Thank you for your answer unfornately im still getting the same error message : Bummer: Did you specify the correct font size for '.title'?