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

Where can we modify the 16px defalt size?

I understand how usefull em is. But don´t know where that value can be updated... I guess the 16px is a browser standard? or is it defined somewhere?

If em = X, and I change X value, all the relative font-size would update?

Thank you very much in advance!

Reggie Williams
Reggie Williams
Treehouse Teacher

Hey Daniel Eguia Azcue. You're correct that 16px is a standard font size. ems are relative to an elements parent element so you're also correct that changing the parent or x would update the size of any children using em units

Change the <body> font-size

1 Answer

As other have said. Yes, it is a ‘standard’. Most browsers give users access to this in their preferences. Although the actual size can be obfuscated behind small, medium, large type language. Whichever is the recommended or default setting is most likely 16.

Chrome > Settings > Appearance > Font size > Medium (Recommended)

Firefox > Preferences > Language and Appearance > Fonts and Colors > Default font > Size > 16

Safari removed their Appearance tab from preferences a few versions back. Users are directed to… Preferences > Websites > Page Zoom > When visiting other websites: > 100%*

  • This will scale the whole website, not just the font size. Chrome and Firefox also offer default zoom settings separate to the font control.