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 Basics (2014) Enhancing the Design With CSS Media Queries

Donna Manizza
Donna Manizza
5,559 Points

Media queries font-size: 5rem

CSS Basics - Media Queries - 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.

I am not sure why this answer is wrong: System says 'did you specify font-size 5rem for h1': ??

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

5 Answers

Ryan Field
PLUS
Ryan Field
Courses Plus Student 21,242 Points

Hi, Donna. You just need to remove the period before the h1 element. You want to target h1 elements, not elements with the .h1 class.

5em, not 5rem

Donna Manizza
Donna Manizza
5,559 Points

Thanks, 5em doesn't work. the challenge says: "target the h1 element and set its font-size to 5rem". So, I'm not sure how to get it to approve my code since that is what I have entered.

Donna Manizza
Donna Manizza
5,559 Points

Thanks, just figured that out!

I did some research on rem versus em. Both are relative units but rem is referenced to an html size and avoids some of the issues with em.

http://designshack.net/articles/typography/whats-the-deal-with-em-and-rem/

Learn new things every day.