HTML5shiv is used to enable styling of HTML5 elements in versions of Internet Explorer prior to version 9. If you are not using this HTML5shiv, then HTML5 tags won’t work on browsers which are less than Internet Explorer 9. This HTML5shiv some people call this with name of “HTML5shim”, but there is no difference between these two names and as noted in the code repository, the only difference is that “one has an m and one has a v – that’s it.

First of all download these HTML5shiv files, and upload those files in your webserver where you are uploading your JavaScript files.

Then add this code in your head section of html document.

[html] <!–[if lt IE 9]>
<script src="js/html5shiv.js"></script>

We are using this above code because prior to internet explorer 9.0 there is not support for HTML5. So for supporting HTML5 in older version of Internet explorer we are using this code snippet and HTML5shiv or HTML5shim, where both are same.

Only apply this HTML5shiv in HTML5 documents that means which have HTML5 doctype declaration, If you want to know more about HTML5 doctype declaration and other doctype declaration.

This is the complete code of HTML5 document after adding HTML5shiv code

[html] <!doctype html>
<meta charset="utf-8">
<title>HTML5 Document with html5shiv</title>
<!–[if lt IE 9]>
<script src="js/html5shiv.js"></script>

Content goes here…

Vivek Vengala

Vivek Vengala is a Online Entrepreneur, Web Developer from Hyderabad India.