我正在编程一个网站的CSS,并意识到Internet Explorer 9显示与其他浏览器(Firefox,Chrome,Safari,IE7和IE8)不同的字体大小。为什么IE9/Firefox显示与其他浏览器不同的字体大小?
我试过使用一些RESETS,我在px
中指定了字体,但IE9仍然显示字体大小的差异。
我试过用font-size
在pt
,in
,百分比,但没有成功。
我改变了之前的字体(格鲁吉亚,时代新罗马,Verdana)。其中一些显示较大,另一些在IE9中较小。
我在IE中检查了缩放设置和文字大小。它们分别是100%和中等。
为了说明,我创建了一个简单的HTML和CSS,您可以看到下面的代码。如何解决这个问题呢?谢谢!
问题:
代码:
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Untitled Document</title>
</head>
<body>
<p>
AAAAA BBBBB CCCCC DDDDD EEEEE FFFFF GGGGG HHHHH IIIII JJJJJ KKKKK LLLLL MMMMM NNNNNN OOOOO PPPPP QQQQQ
</p>
</body>
</html>
CSS
/* RESET */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/* END OF RESET */
body {
background-image:url(GreenLine.png);
background-repeat:no-repeat;
font-family:"Courier New", Courier, monospace;
font-size:12px;
}
通知红色条纹 - http://ie.microsoft.com/testdrive/ - 那些通过在字体呈现差异引起的(和由红色背景,这使得加剧这些浏览器看车) – c69
在面向更多设计的网站(如doctype.com)上,您可能会对此问题做得更好,因为它看起来比字体呈现更像CSS。 – Ishmael
您正在检查Firefox的哪个版本?答案是“重要的”。我希望Firefox的渲染符合IE9。 – thirtydot