<< Latest Post

Monday, October 08, 2012

HTML5 CSS Styling in older versions of IE

HTML5 is gaining traction and many of the common browsers like Chrome, FireFox, safari etc have started supporting some or all of the new HTML5 features. But one of the popular browser and still a standard in many office environments - Internet Explorer, lags behind in HTML5 support. Microsoft has begun supporting the new standards from version 9 and above. 

Internet Explorer will render the HTML5 code as is and will not apply any corresponding styles declared in the style sheet. In order to make the older versions of Internet explorer recognize HTML5 elements for styling, you could use - HTML5Shiv

HTML5Shiv is a JavaScript workaround that helps Internet explorer recognize HTML5 tags and allow it to be styled using CSS style sheets. It is developed & maintained by a bunch of illustrious guys in git Hub. You could download the code locally and add it to your site or point to the googlecode.com location.

Usage –

Add the following code to the head tag of HTML page.

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

Full Source is available in git Hub - https://github.com/aFarkas/html5shiv

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]