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 Units

em relative to parent.

I understand that when the new parent of .title and h1 became .main header and the main header font was set at 2em then the children of main header--.title and h1--maintained the proportion relative to main-header. However, main header is a child of body which has a font-size of 1. What would happen if we changed the font-size of body to 2em.? Would main header's em now be relative to body's em of 2 and would this change the em values of .title and h1.?

1 Answer

Yes all that would happen. If you double body font-size, all children elements with relative font-size would double too.