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

REMs seem redundant. Why not use px instead?

If 1 rem is equal to 16 px, then why not use px instead?

Am I missing some info?

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! Close! 1rem is equal to 1x the default font size of the browser Most current browsers have a default size of 16px, but this could change. Also, not all browsers may have the same default font-size. While I don't know the specifics yet, I'm given to understand that Apple will be enabling web browsing on their Apple watch soon. It could be that 16px is too big there, but they have another default size. Instead of divining what the size is, you can just say "the default" by saying 1rem.

Hope this helps! :sparkles:

Pitrov Secondary
Pitrov Secondary
5,121 Points

But he said if a screen is 2x bigger, then 1px is 2x bigger too. So in the Apple Watch 1px is much smaller? I do not know If i understood it correctly

Sean M
Sean M
7,344 Points

Because rem makes content proportional to the size of other browsers which is important when using multiple devices.