我正在編程一個網站的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