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

Suzanne N
Suzanne N
1,407 Points

When to use EM of REM?

Hi,

I am new here and come from a completely different work sector, so perhaps my questions are a bit easy to answer. ;) I am now working on CSS with great enthusiasm, but I still have a few questions about EM/REM:

  • I can't find a clear answer to when you're using EM or REM?

  • When do you add the above in the writing process? Right at the start or doesn't it matter?

Thanks in advance!

1 Answer

Stanley Nkosi
Stanley Nkosi
4,233 Points

If you can check the MDN Web docs,under the heading CSS values and units. I t explains clearly the EM & REM. EM is the same font-size of the current element.( 1em=16 pixels.) EMs are the most common relative units that you will use in Web Development.

REM-The rem (root em) works exactly the same as the em,except that it will always equal the size of the default base font-size. Just check the MDN Website.