我正在尝试使用html5shiv
使IE7呈现HTML5;我认为html5shiv
可以解决这些问题。然而,Internet Explorer的debugbar仍然在抱怨HTML5标签。
如何使用html5shiv
来使用相同的HTML5内容而不会在debugbar中出错?
<!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>
最佳答案
你不会的。html5shiv只会让这些元素的样式化成为可能。IE7还是不知道。
关于html - HTML5 html5shiv和IE7,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/11601898/