这是我的HTML代码。问题是IE 10不能使用带有h2标签的Exo 2字体。它使用Tahoma。 Firefox和其他人能够正确显示所有字体。IE 10显示Tahoma而不是Google字体
<head>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Exo+2:500,600" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Exo+2:500" />
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Exo+2:600" />
<![endif]-->
</head>
<body>
<p>Here the font is Exo 2. So, everything is just fine!</p>
<h2>Here the font should not be Tahoma, but it is when using IE 10</h2>
</body>
这里是我当前的CSS代码。在H2标签应与外切2和字体重量600,但IE 10宋体,而不是外切2.
body {
font-family: "Exo 2", Tahoma, sans-serif;
font-weight: 500;
font-size: 11px;
color: #000000;
}
h2 {
font-family: "Exo 2", Tahoma, sans-serif;
font-style: normal;
font-weight: 600;
font-size: 12px;
color: #B4166F;
}
我怎么能解决这个问题呢?顺便说一下,我不喜欢使用JavaScript和/或jQuery。
编辑:
我刚刚注意到,如果该值是500所有的时间,这可能有一些做与字体重量600,IE浏览器显示的字体外切2正确。但是,当我用600替代500,IE浏览器将显示宋体,而不是外切2.
body {
font-family: "Exo 2", Tahoma, sans-serif;
font-weight: 500;
font-size: 11px;
color: #000000;
}
h2 {
font-family: "Exo 2", Tahoma, sans-serif;
font-style: normal;
font-weight: 500; /* if this is 500, no problems at all! */
font-size: 12px; /* this works fine, too */
color: #B4166F;
}
<head>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Exo+2:500,600" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Exo+2:500" />
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Exo+2:600" />
<![endif]-->
</head>
<body>
<p>Here the font is Exo 2. So, everything is just fine!</p>
<h2>Here the font is Exo 2 when using IE 10 if the font-weight of h2 is 500 instead of 600. So, works just fine. But when the font-weight is 600, here the font will be Tahoma istead of Exo 2 when using IE 10. Should be Exo 2.</h2>
</body>
编辑2:
我只注意到,如果我键入URL地址栏并按下Enter键,字体Exo 2将在IE中正确显示。当我刷新页面时,Tahoma将再次出现。我不明白为什么会发生这种情况。
那么,接下来我应该尝试什么?
如果您从您的font-family属性中删除Tahoma,会发生什么情况? –
如果我只有Exo 2和sans-serif,IE 10将使用Arial。 – xms