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) Understanding Values and Units Em and Rem Units

Angus Eliott
Angus Eliott
3,793 Points

what am I supposed to do?

could someone tell me what to with this question? " Create a new rule that targets the h2. The h2's parent element has a font-size value of 16px. Use an em unit to give the h2 a font-size value equivalent to 53px." task 2/3 CSS course, how to make a website.

1 Answer

Nathan Tallack
Nathan Tallack
22,160 Points

So what they are doing here is telling you to make the font size for h2 equal to 53px using an em value from it's parent which is 16px.

So that means 53/16=3.3125 which is the em value you need to set h2's font size to.

h2 {
  font-size: 3.3125em;
}

So because h2's parent has a font size of 16px, and 16 times 3.3.125 equals 53, h2 would have end up with a font size of 53px. :)