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

Why not use rem instead of the em function?

Isnt it annoying to keep track of the current font-size of the parent when using the em function?

Isnt it just better and easier to use rem instead? (I never see anyone use rems, but me)

Just declare: html { font-size: 62,5% (which makes the default font-size 10px) }

If you need 40 px you can use 4rem (4x10px) and dont have to think about the parent font-sizes.

I agree that using rem is the better choice nowadays. Browser support is basically 100% and you do not suffer from compounding issues like with em.

2 Answers

I agree somewhat. I still have trouble keeping track of all the different measurement units. The em has been in typography design long before web design though so I think it comes down to what you find the most comfortable using.

I've been using that same method too. It makes much more sense.