How can I use HTML5 in all browsers including IE7,8?

后端 未结 3 1049
轻奢々
轻奢々 2020-12-07 22:45

I want to use HTML5 because it supports in Iphone also and I really liked its capabilities but what can I do if it is not fully compatible with all browsers? Specially IE fa

相关标签:
3条回答
  • Polyfills let you use new HTML5 apis on older browsers. The Modernizr project keeps a list of good ones: https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills

    0 讨论(0)
  • 2020-12-07 23:27

    Simply put, if the markup is valid in HTML 4, change the Doctype and it will work as HTML 5.

    If you want to use the new elements like <article> or <footer>, you will need to include a small javascript snippet in order to register those new types.

    document.createElement("article");  
    document.createElement("footer");  
    

    This will make these new elements usable and stylable like an ordinary <div> element

    0 讨论(0)
  • 2020-12-07 23:37

    You can use http://html5boilerplate.com/ together with http://code.google.com/p/html5shiv/ and you're good to go.

    For some other cool features, like video in old IE, you need to use workarounds like Flash for video and Javascript libs for canvas.

    0 讨论(0)
提交回复
热议问题