1em = 100%吗? [英] Does 1em = 100% ?
问题描述
如果我有风格:
身体
{
字体大小:1em;
}
这有什么不同于:
身体
{
font-size:100%;
}
问候,
Peter Foti
Peter Foti写道:
font-size:1em;
是否有任何不同于:
字体-size:100%;
从技术上讲它们的意思相同(就像1m和100cm一样)。在
练习中,不同的浏览器有不同的错误。
-
David Dorward http://dorward.me.uk/
彼得福蒂 < PE **** @ systolicnetworks.com>写道:
font-size:1em;
vs. font-size:100%;
for body。
根据规范,没有区别,因为对于font-size
属性,em单位和百分比都是相对于封闭元素的字体大小
。
浏览器有一些错误和缺陷,但平均而言,
百分比更安全一点。
但是什么是重点将body的font-size设置为1em或
100%?这只会告诉浏览器无论如何都要使用它。如果你认为有一个特殊的技巧(可能是为了克服一个
浏览器错误),请解释一下。
-
Yucca, http:// www。 cs.tut.fi/~jkorpela/
" Jukka K. Korpela" < JK ****** @ cs.tut.fi>在消息中写道
news:Xn ***************************** @ 193.229.0.31。 ..但是将body的font-size设置为1em或
100%是什么意思?这只会告诉浏览器无论如何都要使用它。如果你认为有一个特殊的技巧(可能是为了克服一个
浏览器错误),请解释一下。
我在某处阅读这个将字体大小设置为100%的新闻组需要
关注一些IE 5.5的bug。
Peter
If I have a style:
body
{
font-size: 1em;
}
Is that any different than:
body
{
font-size: 100%;
}
Regards,
Peter Foti
Peter Foti wrote:
font-size: 1em;
Is that any different than:
font-size: 100%;
Technically they mean the same (just as 1m is the same as 100cm). In
practise, different browsers have different bugs relating to them.
--
David Dorward http://dorward.me.uk/
"Peter Foti" <pe****@systolicnetworks.com> wrote:
font-size: 1em; vs. font-size: 100%;
for body.
By the specification, there is no difference, since for the font-size
property, both the em unit and percentages are relative to the font-size
of the enclosing element.
Browsers have some bugs and deficiencies for both, but on the average,
percentages are a little safer.
But what would be the point of setting font-size of body to 1em or to
100%? That would just tell the browser to use whatever it does anyway. If
you think there is a particular trick (maybe intended to overcome a
browser bug) involved, please explain.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
"Jukka K. Korpela" <jk******@cs.tut.fi> wrote in message
news:Xn*****************************@193.229.0.31. ..But what would be the point of setting font-size of body to 1em or to
100%? That would just tell the browser to use whatever it does anyway. If
you think there is a particular trick (maybe intended to overcome a
browser bug) involved, please explain.
I read somewhere in this newsgroup that setting the font size to 100% takes
care of some IE 5.5 bugs.
Peter
这篇关于1em = 100%吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!