2012-07-22 46 views
1

我想讓IE7呈現HTML5使用html5shiv;我以爲html5shiv會解決這些問題。但是,Internet Explorer的調試欄仍在持續關注HTML5標籤。HTML5 html5shiv和IE7

debugbar_output

我怎樣才能解決這個使用html5shiv使用而不debugbar錯誤同一HTML5內容?

<!DOCTYPE html> 
<!-- 
    See this page for language codes: 
    http://tlt.its.psu.edu/suggestions/international/web/tips/langtagscript.html 
--> 
<html class="no-js" lang="en-US"> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    <title>HTML5 Page Template</title> 
    <!-- 
     html5shiv via CDN 
     Provides HTML5 support in hateful IE versions 
     CDN: http://cdnjs.com/ 
    --> 
    <!--[if lt IE 9]> 
     <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6/html5shiv.min.js"></script> 
    <![endif]--> 
    </head> 
    <body> 
    <div id="page"> 
    <header> 
     <h1><a href="#">Standard HTML5 Page</a></h1> 
    </header> 
    <nav> 
     <ul> 
     <li><a href="#">Home</a></li> 
     <li><a href="#">Archives</a></li> 
     <li><a href="#">About</a></li> 
     </ul> 
    </nav> 
    <section id="featured"> 
     <article> 
     <header> 
      <h1><a href="#">Title Foo1</a></h1> 
     </header> 
     <section> 
      <p>Lorem ipsum...</p> 
     </section> 
     </article> 
     <article> 
     <header> 
      <h1><a href="#">Title Foo2</a></h1> 
     </header> 
     <section> 
      <p>Lorem ipsum...</p> 
     </section> 
     </article> 
    </section> 
    <section id="ads"> 
     <a href="http://careers.stackoverflow.com/">Get a better job!</a> 
    </section> 
    <footer> 
     <p>Insert footer info here</p> 
    </footer> 
    </div> 
    </body> 
</html> 
+0

DebugBar是IE的第三方加載項;鑑於你所做的是一個IE黑客攻擊,DebugBar可能無法準確報告IE實際正在做什麼。 – Spudley 2012-07-22 16:21:45

回答

9

你不知道。 html5shiv只能夠設置這些元素的樣式。 IE7仍然不會了解它們。

0

我也有越來越html5shiv問題在IE測試工作(假設你使用IE瀏覽器測試儀),我發現,當我強迫IE8不會發生使用標籤來模擬IE7,像這樣:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7;"> 

(查看我對類似問題的回答here)。基於這種經驗,我懷疑IE測試人員可能對html5shiv有問題:在實際的IE7中測試你的頁面可能是值得的,以確保這裏真的存在問題。