Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default HTML font size

Tags:

I wonder what the default html font-size is and I can't find the answer.

What I mean is this :

What is the font size in pixels corresponding to this :

html {     font-size: 100%; } 

It could be useful to know this if you need to calculate rem font sizes.

like image 996
Romain Braun Avatar asked Jul 02 '14 23:07

Romain Braun


2 Answers

The default is 16px.

If you create an HTML file with any text in it, open it in Chrome, you can check the computed styles.

enter image description here

like image 113
Dryden Long Avatar answered Oct 04 '22 22:10

Dryden Long


In the W3 CSS specification, there is no definite default font-size other than the relative value medium.

That being said, a quick test with the developer versions of IE, Firefox, and Chrome all show that the de facto standard is 16px. I would be interested to see someone test this on mobile versions.

Edit: As of 2017-03-20, the stable versions of Chrome, Firefox, Edge, and IE on the desktop as well as Chrome, Firefox, and Opera on mobile all default to the de facto standard of 16px for font-size.

like image 24
ubomb Avatar answered Oct 04 '22 22:10

ubomb