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

How do we know what the default px is? Or is it always 16px?

^^

3 Answers

Idan Melamed
Idan Melamed
16,285 Points

"If you do not specify a font size, the default size for normal text, like paragraphs, is 16px (16px=1em)."

http://www.w3schools.com/css/css_font.asp

It depends on a few things. Basically percentages and em's are both scalable, meaning they'll adjust depending on the size of document. They're both responsive.

This blog gives a great explanation of the differences. He gives a slightly biased answer for his preference for working with percentages. I wouldn't get to hung up on trying to force yourself to use em's in your work but understanding the theory behind them is important because you will come across them in other people's work.

Thanks for both your answers! I get the theory behind ems.. just wasn't sure if 16px was the default size of text unless otherwise stated..

for example.. would there every be a situation where a browser defaults the text size to 12px, instead of 16px?