2016-08-02 55 views
0

這是我的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將再次出現。我不明白爲什麼會發生這種情況。

那麼,接下來我應該嘗試什麼?

+0

如果您從您的font-family屬性中刪除Tahoma,會發生什麼情況? –

+1

如果我只有Exo 2和sans-serif,IE 10將使用Arial。 – xms

回答

0

已解決。工具 - > Internet選項 - >重置Internet Explorer設置。這幫助了我。現在IE 10在Google字體下工作得很好。

0

條件註釋在IE9後不再起作用。我會在其他地方看看爲什麼Exo2不能在h2中工作,因爲這不應該發生。

+0

字體在h1和h2中不起作用。 – xms