2016-12-06 18 views
-3

據我瞭解html5shiv.js文件「教」的瀏覽器如IE正確處理CSS3:在哪裏把鏈接到html5shiv.js?之前css <styles>或與其他<script>標籤?

<!--[if lt IE 9]> 
    <script src="scripts/html5shiv.js"></script> 
<![endif]--> 

哪裏應該包括它 - 之前的風格標籤,或在頁面的底部?

<!DOCTYPE html> 
<html> 
<head> 
    <title></title> 
    <meta charset="utf-8" /> 
    <!-- Where to put this link to html5shiv? --> 
    <!--[if lt IE 9]><script src="scripts/html5shiv.js"></script><![endif]--> 
    <link rel="stylesheet" href="some.css"/> 
</head> 
<body> 

    <!--html content --> 

    <!-- scripts should be loaded after DOM is constructed --> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> 
    <script type="text/javascript"> 
     // some scripts here.. 
    </script> 
</body> 
</html> 
+1

「據我瞭解html5shiv.js文件 」教「 像ie瀏覽器正確處理CSS3」 - 事實並非如此。它允許 Quentin

+3

但是要回答你的問題,把它作爲第一件事情在你現在擁有它的地方 – mplungjan

+0

@Quentin昨天dotJS的很多開發者不得不支持IE9,因爲他們的公司老闆告訴他們。不久之前,我的辦公室在IE8上進行了標準化。 – mplungjan

回答

2

如果你開始使用新的工具或代碼片段或庫,你不乍一看明白,你真的應該開始讀手冊!

包括HTML5的希夫在在有條件的評論頁面,並的任何樣式表後。

參見:https://github.com/afarkas/html5shiv

+0

Ahha。謝謝!所以它應該在頭部,但是在css樣式之後 –