Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

html

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 family. So is there a way by adding some js script e.t.c. so that HTML5 and its js api work normally in IE also as it works on other browsers like chrome, firefox and opera e.t.c.? So that I can use it without thinking of browser compatibility issues. There are also many game engines in html5 but what if this is not supported major IE browsers. Or can some one tell that how much advantage can I take of html5 without thinking of compatibility issues?

Thanks in advance

like image 645
Hafiz Avatar asked Feb 01 '11 06:02

Hafiz


People also ask

Is HTML5 supported by all older browsers?

HTML5 is now compatible with all popular browsers (Chrome, Firefox, Safari, IE9, and Opera) and with the introduction of DOCTYPE, it is even possible to have a few HTML features in older versions of Internet Explorer too.

Does HTML5 work on all platforms?

It's Designed To Work Cross-Platform HTML5's primary advantage is that it works across a wide range of devices, from PC browsers to mobile phones, tablets, and even Smart TVs. As long as a device uses a browser equipped to run HTML5, it can theoretically serve as a viable platform for HTML5 games.


2 Answers

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.

like image 78
Horia Dragomir Avatar answered Oct 04 '22 03:10

Horia Dragomir


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

like image 28
Anders Nygaard Avatar answered Oct 04 '22 01:10

Anders Nygaard