body {font-size:100.01%; } vs body {font-size:100%; }? [英] body { font-size: 100.01%; } vs body { font-size: 100%; }?
问题描述
我应该为 body
, {font-size:100.01%; }
或 {font-size:100%; } ? c>
{font-size:100.01% }
?在 html {}
甚至
如果我使用 body {font-size:62.5%;}
编辑:2010年5月3日 p>
今天我在这里找到关于 100.01%
的信息 - http://www.communitymx.com/content/article.cfm?cid=FAF76&print=true
字体的这个奇怪的100.01%值
大小补偿了几个浏览器
的错误。首先,设置默认主体
字体大小以百分比(而不是em)
消除了一个IE / Win问题,
如果它们以后设置,则从
比例中增加或收缩字体in
ems in other elements。另外,
一些版本的Opera将绘制一个
默认字体大小100%太小
相比其他浏览器。 Safari,在
另一方面,有一个问题与
font-size为101%。当前的最好的
建议是使用该属性的100.01%值
。
保留 {font-size:100%}
/ p>
声明 body(或html){font-size:100.01%}
补偿舍入误差,特别是在Opera和Safari的旧版本中。
相对字体大小(%,em)总是相对于父元素的字体大小进行解释。因此,在顶层元素中实现初始复位并不是一个坏主意,您可以使用 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%}
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%}
.
这篇关于body {font-size:100.01%; } vs body {font-size:100%; }?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!