Getting your HTML5 Design to Work in Internet Explorer

Problem

So far, IE8 and below lack support for HTML5 elements. In fact HTML5 elements won’t render at all in those versions (hopefully IE9 will fix this). An HTML5 template will look pretty silly in IE8 and below, but there’s a way to fix that.

Solution

By using Internet Explorer conditional tags and an HTML5 enabling script we can assure a somewhat decent rendering of your HTML5 page in IE.

Place the following code into your document’s <head>:

1
2
3
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

The above script uses the <!--[if IE]> to apply the external javascript file html5.js if the client’s browser is Internet Explorer. This wonderfully fantastical script was written by Remy Sharp, via his website (remy sharp’s b:log).

  • Facebook
  • Twitter
  • Reddit
  • email
  • del.icio.us
  • Digg
  • MySpace
  • Slashdot
  • Google Bookmarks
  • Live
  • StumbleUpon
  • Technorati

Leave a reply