CSS

Daniel Eguia Azcue
Daniel Eguia Azcue
2,243 Points

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
seal-mask
.a{fill-rule:evenodd;}techdegree
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

Alan Brown
Alan Brown
20,353 Points

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.