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 Rem Units

Why use em units when you can just use rem?

If using em units in most cases will cause us to run into compounding issues, why should someone want to ever use em units compared to rem?

Sako Kassabian : 2 years later and I'm still wondering the same question myself :)

2 Answers

Here is a great website by Jeremy Church and when em and rem are more appropriate to use for styling than the other Confused About REM and EM?.

Mark Tripney
Mark Tripney
7,839 Points

I would say, Sako, that if you're designing responsively, then it might actually be a benefit to have the inheritance property of the em units. For example, if you're reducing a heading size to accommodate a smaller screen, then the nav links (for example) embedded within the header can easily scale down too, keeping the whole thing relative... if you're using ems!

Anthony c
Anthony c
20,907 Points

It sounds like ems are good to use as long as you "plan" accordingly. In other words, apply your sizing in ems to parent elements first, then to siblings. The only time you'll run into an issue is if you define ems on siblings first, and then to parents. Or, if you change ems for the sibling without changing them for the parent.