Skip to content

Instantly share code, notes, and snippets.

@KruegerDesigns
Created January 4, 2012 22:50
Show Gist options
  • Save KruegerDesigns/1562644 to your computer and use it in GitHub Desktop.
Save KruegerDesigns/1562644 to your computer and use it in GitHub Desktop.
Add Internet Explorer version to your html tag class.
// Added this js to give the HTML tag IE detection (e.g. ie7).
if($.browser.msie)
{
$('html').addClass('ie' + ($.browser.version).slice(0,1));
}
@KruegerDesigns
Copy link
Author

Greetings,

I used this with Modernizer to get more control over IE7 display issues. Google Fonts were having different widths in IE7, this script gave me options for work arounds.

NOTE:
If you use IE7 compatibility mode in IE8, be sure to wrap it in [if IE 8]:

<!--[if IE 8]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<![endif]-->

Otherwise this code will return "ie7" for IE9.

Cheers,
Adam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment