最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - HTML5 for IE6.0 - Stack Overflow

programmeradmin3浏览0评论

Do you know any method to optimize this HTML Code to IE6 or 7 (or 8) without adding any HTML elements, or the IE is skipping all the HTML5 elements?

If i just want to format elements with CSS, - i dont want to use other features - is the document.createElement("nav") DOM element create enough to scam IE and make a plain HTML document?

<!DOCTYPE HTML>
<head>
<meta charset="UTF-8">
<title>title</title>
<link type="text/css" rel="stylesheet" href="reset.css">
<link type="text/css" rel="stylesheet" href="style.css">
</head>
<body>
<header>code of header</header>
<nav>
code of nav
</nav>
<section>
code of gallery
</section>
<article>
code of article
</article>
<footer>code of footer</footer>
</body>
</html>

Thank you.

More info about DOM create elements in IE6, IE7 and IE8 with html5 enabling script » here

Do you know any method to optimize this HTML Code to IE6 or 7 (or 8) without adding any HTML elements, or the IE is skipping all the HTML5 elements?

If i just want to format elements with CSS, - i dont want to use other features - is the document.createElement("nav") DOM element create enough to scam IE and make a plain HTML document?

<!DOCTYPE HTML>
<head>
<meta charset="UTF-8">
<title>title</title>
<link type="text/css" rel="stylesheet" href="reset.css">
<link type="text/css" rel="stylesheet" href="style.css">
</head>
<body>
<header>code of header</header>
<nav>
code of nav
</nav>
<section>
code of gallery
</section>
<article>
code of article
</article>
<footer>code of footer</footer>
</body>
</html>

Thank you.

More info about DOM create elements in IE6, IE7 and IE8 with html5 enabling script » here

Share Improve this question edited Aug 18, 2024 at 8:29 VLAZ 29.1k9 gold badges63 silver badges84 bronze badges asked Apr 17, 2010 at 22:14 RépásRépás 1,8208 gold badges28 silver badges55 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

This code should work fine with IE6. Though, you may want to define your elements in your stylesheet to give them the properties you are looking for. Something like this:

header, footer, nav, section, article {
  display:block;
}

EDIT: Oops. I am wrong about this. Shouldn't have posted so quickly. Reading this (which you probably just read as well): http://blog.whatwg/supporting-new-elements-in-ie

It appears that the Javascript hack you indicated above may be the only way to get these elements to render properly.

This script looks to be pretty handy and may solve your problem nicely, though I have not tested it: http://remysharp./2009/01/07/html5-enabling-script/

IE8 does not support html5, just some random bits and pieces of it. IE6 or 7 even less.

发布评论

评论列表(0)

  1. 暂无评论