【发布时间】:2012-07-22 16:15:16
【问题描述】:
我正在尝试使用html5shiv 让 IE7 呈现 HTML5;我认为html5shiv 会解决这些问题。但是,Internet Explorer 的调试栏仍然对 HTML5 标记感到不满。
如何使用html5shiv 解决此问题,以便在调试栏中使用相同的 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>
【问题讨论】:
-
DebugBar是IE的第三方插件;鉴于您正在做的是 IE hack,DebugBar 可能无法准确报告 IE 实际在做什么。
标签: html internet-explorer html5shiv