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
Katherine Hammitt
1,201 PointsWhere can I find more information on em/rem use versus pixels?
Where can I find more information on em/rem use versus pixels? I have completed the CSS basics course but I still am not fully grasping this concept. I understand that it is a relative unit based on the parent element.... is the parent element defined in px or em?
1 Answer
Patrik Horváth
11,110 PointsHi, so "em" are good if you want do math or remember every parent element size ..., "rem" with combination ROOT property in css you can setup 1rem = 10px for example or 1 rem = 1px
Root info : https://developer.mozilla.org/en-US/docs/Web/CSS/:root
for me use REM always ( em = OLD , rem = NEW )
Katherine Hammitt
1,201 PointsKatherine Hammitt
1,201 PointsWhy would you use rem over px? Why do the math at all? Is it so you only have to change the parent element to change everything?