HTML5 for IE6.0 [英] HTML5 for IE6.0

查看:136
本文介绍了HTML5 for IE6.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您是否知道在不添加 任何 HTML元素的情况下优化此HTML代码到IE6或7(或8)的任何方法,或者IE正在跳过所有HTML5元素?

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?

如果我只是想用CSS格式化元素, - 我不想使用其他功能 - 是document.createElement(nav)DOM元素创建足够诈骗IE并制作纯HTML文档?

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>

谢谢。

更多信息DOM使用html5启用脚本在IE6,IE7和IE8中创建元素»此处

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

推荐答案

此代码适用于IE6。但是,您可能希望在样式表中定义元素,以便为它们提供您要查找的属性。这样的事情:

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;
}


编辑:哎呀。我错了。不应该这么快发布。阅读本文(你可能也读过): http:// blog。 whatwg.org/supporting-new-elements-in-ie

看来您上面指出的Javascript黑客可能是获取这些元素的唯一途径正确渲染。

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

这个脚本看起来非常方便,可以很好地解决你的问题,虽然我还没有测试过: http://remysharp.com/2009/01/07/html5-enabling-script/

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

这篇关于HTML5 for IE6.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆