IE HTML5 & CSS3 with Selectivizr & HTML4SHIM

While reading though my book about HTML5 and CSS3 they talk about a JavaScript library that helps Internet Explorer understand CSS3, and its new ways of styling websites. Selectivizer, previously IE-CSS3, will let you use good HTML5 code and some of the new ways of doing styling in CSS3 without adding lots of extra code that other browsers don’t need.

The problem with a lot of these JavaScript libraries is that they expect you to know how to get these things working without much explanation. So after a few pages of searching Google I did find Rey Bango’s blog and he gives a good explanation on how to use it and set it up.

Here is the code snippet that he gives about how to get it running on a page:

<script src="jquery-1.4.2.min.js"></script>
<!--[if lt IE 9]>
<script src="selectivizr.js"></script>
<noscript><link rel="stylesheet" href="css/ie-fallback.css" media="screen, projection"></noscript>
<![endif]-->
<link href="style.css" rel="stylesheet">

Also if you are trying to use HTML5 for building new websites or fixing up an old site you should also check out the html5shim that will fix IE so that it will understand some of the new elements added to HTML5.

To get it working on your site just add this code, no downloading needed because it’s all hosted up on Google Code:

<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

These are a few things that are needed to make a site work right in IE because IE is such garbage.