3 Solutions for Supporting Internet Explorer
In the beginning, Internet Explorer was the progressive browser. After a period of inactivity, Internet Explorer became the bane of our existence. Microsoft has since recommitted to their browser but the fact remains that sometimes modern Internet Explorer is lagging just a bit behind WebKit-based browsers and Firefox. We also need to accommodate for earlier versions of IE. The following will allow your sites to quickly and almost magically work better in Microsoft's flagship browser!
<!--[if lt IE 9]> <script src="dist/html5shiv.js"></script> <![endif]-->
Selectivizr.js is an incredible resource, polyfilling loads of unsupported CSS selectors and properties, including the all-important
last-child. On a recent redesign, I was able to plug selectivizr in and not miss a beat in older Internet Explorers. Here's how I implemented it:
<!--[if lte IE 8]><script src="js/libs/selectivizr.js"></script><![endif]-->
An absolute must for your modern projects. Only loaded for old IE's
<html> Conditional Comments
The ugliest conditional comment series you'll ever see. Ever. But ugly or not, the fact remains that this code workers exactly as intended:
<!DOCTYPE html> <!--[if lt IE 7 ]> <html class="ie6" lang="en"> <![endif]--> <!--[if IE 7 ]> <html class="ie7" lang="en"> <![endif]--> <!--[if IE 8 ]> <html class="ie8" lang="en"> <![endif]--> <!--[if IE 9 ]> <html class="ie9" lang="en"> <![endif]--> <!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
While Internet Explorer is catching up to its competitors, the fact remains that their old browsers are still relatively popular, especially in developing countries. The good news is that these resources work in all of those browsers and are not expensive in modern browsers!