这个问题已经解决了!
有一些奇怪的东西。
我正在使用html { font-size: 100% }
和body {font-size: 62.5%}
,因此我在CSS中有1em == 10px
。我以前做了好几次。
现在在我的页面上,除了IE8和IE7(XP模式)导航中的字体外,一切正常,字体大小
我在这里弄乱了相关的HTML / CSS代码http://jsfiddle.net/gk4j9/3/
使用modernizr进行浏览器能力切换以获得渐变和阴影
缩放是100%
文字缩放是中等
编辑
测试请到这里
http://netrenderer.com/index.php
并测试此地址
http://fiddle.jshell.net/gk4j9/3/show/light/
编辑
font-size是2em,所以应该是20px。
如果我在IE8中用开发者工具(18px)更改为1.8em,它看起来与IE9和其他浏览器中的2em完全相同
<div class="l-fullwrap clearfix">
<header class="page-header">
<div class="l-header-nav-primary">
<nav class="primary">
<ul>
<li class="first has-children">
<a href="javascript:;">
<span>Item 1</span>
</a>
</li><li class="has-children">
<a href="javascript:;">
<span>Item 2</span>
</a>
</li><li class="has-children">
<a href="javascript:;">
<span>Item 3</span>
</a>
</li>
</ul>
</nav>
</div>
</header>
</div>
html {
font-size: 100%;
}
html, button, input, select, textarea {
font-family: sans-serif;
color: #222;
}
body {
font-size: 62.5%;
line-height: 1.4em;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
nav ul, nav ol {
list-style: none;
list-style-image: none;
}
a, a:link, a:visited {
color: #EFAA03;
}
a, a:link, a:visited {
color: #EFAA03;
}
a:visited {
color: #551A8B;
}
a, a:link, a:visited {
color: #EFAA03;
}
a {
color: #00E;
}
/* Primary Nav */
.l-header-nav-primary {
position: absolute;
right: 0px;
top: 45px;
}
nav.primary {
border-top: 1px solid #CDCDCD;
border-bottom: 1px solid #AAAAAA;
}
nav.primary,
nav.primary li{
display: inline-block;
*zoom: 1;
*display: inline;
vertical-align: baseline;
}
.no-cssgradients nav.primary li,
nav.primary li{
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d2d2d2', endColorstr='#979696',GradientType=0 ); /* IE6-9 */
}
.cssgradients nav.primary li,
nav.primary li{
line-height: 3.2em;
padding-right: 1px;
background: #979696; /* Old browsers */
background: -moz-linear-gradient(top, #d2d2d2 0%, #979696 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#d2d2d2), color-stop(100%,#979696)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #d2d2d2 0%,#979696 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #d2d2d2 0%,#979696 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #d2d2d2 0%,#979696 100%); /* IE10+ */
background: linear-gradient(top, #d2d2d2 0%,#979696 100%); /* W3C */
filter: none;
}
nav.primary li.last{
padding-right: 0;
}
.no-cssgradients nav.primary a,
nav.primary a {
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#b6b6b6',GradientType='0' ); /* IE6-9 */
}
.cssgradients nav.primary a,
nav.primary a{
display: block;
background: #b6b6b6; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #b6b6b6 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#b6b6b6)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#b6b6b6 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#b6b6b6 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#b6b6b6 100%); /* IE10+ */
background: linear-gradient(top, #ffffff 0%,#b6b6b6 100%); /* W3C */
filter: none;
}
nav.primary a {
display: block;
padding: 0 10px;
font-size: 2em;
font-family: Calibri;
font-weight: bold;
color: #333333;
text-decoration: none;
text-transform: uppercase;
text-shadow: 1px 1px rgba(255,255,255, 0.65);
height: 100%;
}
.no-textshadow nav.primary a span{
display: inline-block;
*zoom: 1;
*display: inline;
background-color: #E0E0E0;
-ms-filter: "Chroma(Color=#E0E0E0) DropShadow(OffX=1, OffY=1, Color=#FFFFFF)";
filter: Chroma(Color=#E0E0E0) DropShadow(OffX=1, OffY=1, Color=#FFFFFF);
}
.no-textshadow nav.primary li.active a span,
.no-textshadow nav.primary a:focus span,
.no-textshadow nav.primary a:hover span,
.no-textshadow nav.primary a:active span {
display: inline-block;
*zoom: 1;
*display: inline;
background-color: transparent;
-ms-filter: "none";
filter: none;
}
nav.primary li.active a,
nav.primary a:focus,
nav.primary a:hover,
nav.primary a:active,
.no-cssgradients nav.primary li.active a,
.no-cssgradients nav.primary a:focus,
.no-cssgradients nav.primary a:hover,
.no-cssgradients nav.primary a:active {
filter: none;
}
.cssgradients nav.primary li.active a,
.cssgradients nav.primary a:focus,
.cssgradients nav.primary a:hover,
.cssgradients nav.primary a:active,
nav.primary li.active a,
nav.primary a:focus,
nav.primary a:hover,
nav.primary a:active {
color: #FFFFFF;
background:#231F20;
text-shadow: none;
outline: none;
}
答案 0 :(得分:0)
我明白了。
在我的XP模式下,我没有安装Calibri字体。所以它使用不同的字体。
血腥我!