IE 8中的HTML5标签& IE 7 [英] HTML5 tags in IE 8 & IE 7
问题描述
正如我在标题中所提到的,Firefox(firebug)中的
,IE-9/10,Chrome显示如下:
Hi as I mentioned in title, in Firefox (firebug), IE-9/10, Chrome it shows properly like:
<footer>
<div>...</div>
</footer>
在IE-8/7中显示如下:
where as in IE-8/7 it shows like:
<footer />
<div>...</div>
</footer/>
感谢任何帮助。
推荐答案
IE7 / 8不支持新的HTML5标签,如页脚
。
IE7/8 do not support the new HTML5 tags like footer
.
如果你使用它们,你会遇到这样的问题,结果会出现毛刺。
If you use them, you will get issues like this, and rendering glitches as a result.
以 html5shiv 和 Modernizr polyfill脚本。使用其中一个库将HTML5标签的支持添加到旧的IE版本。
There are work-arounds in the form of the html5shiv and Modernizr polyfill scripts. Use one of these libraries to add support for HTML5 tags to old IE versions.
如果您不准备使用Javascript库来修复IE的HTML5支持,那么另一个选项是停止使用这些标记并切换回使用< div>
标记的所有内容,并使用类在语义上识别它们。
If you're not prepared to use a Javascript library to fix IE's HTML5 support, the other option is to stop using these tags and switch back to using <div>
tags for everything, with classes to identify them semantically.
这篇关于IE 8中的HTML5标签& IE 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!