Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
261 views
in Technique[技术] by (71.8m points)

html - HTML5 tags in IE 8 & IE 7

Hi as I mentioned in title, in Firefox (firebug), IE-9/10, Chrome it shows properly like:

<footer>
    <div>...</div>
</footer>

where as in IE-8/7 it shows like:

<footer />
    <div>...</div>
</footer/>

Any help is appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...