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

Is 1 em always 16 pixels?

The lessons stated to convert pixels to ems in order to have responsive fonts. It stated that ems are always a fraction of the default pixel size. So, is this default size always 16 and do we always divide by 16 to get the right measurements?

3 Answers

Charles Smith
Charles Smith
7,575 Points

No.

From this stackoverflow question, you can see that 1em is not 16px, at least in 2013 when the answer was given.

For this reason, you might want to do as the question suggests - set a body font to 16px, and then your em's will be relative to that. You could also use a "normalize" stylesheet to set a baseline across browsers.

Thanks!

Andre Kucharzyk
Andre Kucharzyk
4,479 Points

That makes no sense whatsoever. Whats the point of using EMS if i set stiff 16px value in body, as a deafult font size. How is it responsive then?