html 5标签不支持ie9下面? [英] html 5 tag not supporting on below ie9?
问题描述
我刚访问过apple.com,他们使用了一些像nav这样的html5标签。它在所有broswer工作但我尝试测试html5代码它不在ie8和ie7工作。我没有得到苹果网站在所有浏览器中工作的问题。
i just visited apple.com and they use some html5 tag like nav. it is working in all broswer but i i try to test html5 code it is not working in ie8 and ie7. i am not getting what is the problem how apple site working in all browser.
<!DOCTYPE html >
<html>
<head xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>html 5</title>
<style>
#header { margin:0 auto; width:980px; overflow:hidden; border:solid 1px #F00}
</style>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<header id="header">adfadf</header>
</body>
</html>
推荐答案
旧版本的IE不会处理新的HTML5标题,导航,文章,页脚,地址等元素作为未知元素。
older versions of IE don't treat the new HTML5 elements like header, nav, article, footer, address as "unknown" elements.
您可以使用简单的JavaScript方法将新元素简单地引入旧的IE家庭成员:
You can simply introduce the new elements to the old IE family members by using a simple JavaScript approach:
document.createElement("article");
document.createElement("footer");
document.createElement("header");
document.createElement("hgroup");
document.createElement("nav");
查看文章 HTML5 Shiv 等 modernizr framewoerk
HTH,
- 亨森
这篇关于html 5标签不支持ie9下面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!