问题描述
我目前正在开发网站,我不知道为什么IE10中的文字比Chrome中的文字大。 (我已确保这两个浏览器都设置为100%缩放 - 不再更多,不少。)
I'm currently working on developing a site, and I can't figure out why the text displays bigger in IE10 than it does in Chrome. (I've made sure that both of the browsers are set to 100% zoom--no more, no less.)
我已在我的CSS重置: body {font-size:1em; }
。在Chrome(v27.0.1453.116 m)中,如果我将CSS中的规则更改为 font-size:100%;
或 font-size:16px;
,没有任何明显的变化。对我来说,这表示在Chrome中,1em = 16px。但是比例字体大小( em
和%
)在IE中显示的更大,似乎是1em = 21px。
I've got a reset in my CSS: body { font-size: 1em; }
. In Chrome (v27.0.1453.116 m), this displays as expected--if I change that rule in the CSS to font-size: 100%;
or font-size: 16px;
, nothing visibly changes. This, to me, indicates that in Chrome, 1em = 16px. But the proportional font-sizes (em
and %
) display much bigger in IE, at what appears to be 1em = 21px.
我有两个图片显示了 body {font-size:1em; }
,但由于我还没有10个声望,我不能发布完整的URL。但是,它们的主机是imgur,其文件名如下:
I have two images show the difference when body { font-size: 1em; }
, but since I don't have 10 reputation yet, I can't post the full URLs. They're hosted on imgur, though, and their filenames are as follows:
-
font-size :1em;
font-size: 1em;
in Chrome:
-
font-size:1em;
font-size: 1em;
in IE10:
如果我设置 font- size
使用 px
,那么我得到一致的结果 - Chrome和IE10将一致显示。但是对于字体大小,使用 px
会打击我作为不太喜欢的做法。
If I set font-size
using px
, then I get consistent results--both Chrome and IE10 will display consistently. But using px
for font sizes strikes me as less-than-preferred practice these days.
HTML和CSS在。我包括所有的CSS,这可能是有点不必要的,但我认为最好提供更多的上下文,而不是更少。
You can see the HTML and the CSS in this jsFiddle I made. I included all of the CSS, which may have been a little unnecessary, but I thought it'd be better to provide more context rather than less.
任何人都可以帮助我找出为什么IE10的显示 1em
比Chrome大,我可以做什么呢?
Can anyone help me figure out why IE10's displaying 1em
bigger than Chrome, and what I can do about it?
感谢一堆。
编辑 - 数据,一旦我发布了这个精心设计的问题,我就会知道发生了什么。我已经设置IE缩放到100%,但IE也有一个文本大小选项,由于某些原因,设置为最大。设置为中可以解决问题。
EDIT - Figures that as soon as I posted this elaborate question, I'd figure out what was going on. I had set the IE zoom to 100%, but IE also has a "Text size" option that, for some reason, was set to "Largest". Setting it to "Medium" fixed the problem.
推荐答案
我已经解决了我自己的问题,一个傻瓜。
I've "solved" my own problem, 'cause I'm a fool.
IE10有两个设置,在视图菜单下,这改变了显示的大小。我确定缩放设置设置为100%,但完全忽略了文字大小设置,设置为最大。设置为中固定我的问题,并使它的IE和Chrome显示相同。
IE10 has two settings, both under the "View" menu, which change the size of what's displayed. I'd made sure that the "Zoom" setting was set to 100%, but completely overlooked the "Text size" setting, which was set to "Largest". Setting it to "Medium" fixed my issue, and made it so both IE and Chrome displayed identically.
这篇关于为什么是“font-size:1em” IE10比Chrome大些?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!