Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

body { font-size: 100.01%; } vs body { font-size: 100%; }?

What should i keep for body, {font-size: 100.01%; } or { font-size: 100%; }?

what is {font-size: 100.01%; }? and is it really good to mention font-size in html{} even

If I'm using body {font-size: 62.5%;}

Edit : 3 May 2010

Today i found info about 100.01% at here - http://www.communitymx.com/content/article.cfm?cid=FAF76&print=true

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.

Is it good to keep body { font-size:100.01%} in place of {font-size:100%}

like image 875
Jitendra Vyas Avatar asked Apr 24 '10 03:04

Jitendra Vyas


1 Answers

The declaration body (or html) { font-size: 100.01% } compensates rounding errors, in particular in older versions of Opera and Safari. Both would otherwise display fonts that are too small.

A relative font-size (%, em) is always interpreted relative to the font size of the parent element. So it's not a bad idea to implement kind of a initial reset in the top element, which you can achieve with body {font-size: 100%}.

like image 199
Andreas Schuldhaus Avatar answered Sep 25 '22 17:09

Andreas Schuldhaus