Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is using font-size: 100.01% still needed, and for what browsers?

I'm cleaning up some old and terrible css, which includes:

body {
  font-size: 100.01%
}

While researching, I found body { font-size: 100.01%; } vs body { font-size: 100%; }?, which explains the reason for setting font-size to 100.01%, but doesn't tell what browsers this 'fix' targets.

Do any modern browsers still face this issue, and if so, which and what versions?

like image 422
David Smith Avatar asked Dec 27 '10 20:12

David Smith


People also ask

What is the default font-size in most browsers?

The default font size in most web browsers equals 16px . This value is used in font-size property of the root element on every website.

Why do we use the font-size option?

The font size is a number that indicates how many points are in the height of the text, or high tall the text is in points. A point is 1/72 of an inch, so a 12-point font would be 12/72 of an inch.

Should I set font-size HTML?

If you really want to follow the rules and still keep flexibility, you should consider this: html 's font-size is the root font-size, which means it will be used as a base for rem calculation, but that's it, nothing else. It shouldn't be used for real text size calculation: it's just a kind of trick for some browsers.


1 Answers

Answer taken from CSS: Getting Into Good Coding Habits by Adrian Senior

This odd 100.01% value for the font size compensates for several browser bugs. First, setting a default body font size in percent (instead of em) eliminates an IE/Win problem with growing or shrinking fonts out of proportion if they are later set in ems in other elements. Additionally, some versions of Opera will draw a default font-size of 100% too small compared to other browsers. Safari, on the other hand, has a problem with a font-size of 101%. The current "best" suggestion is to use the 100.01% value for this property.

like image 77
Bobby Avatar answered Sep 20 '22 07:09

Bobby