Skip to content

Instantly share code, notes, and snippets.

@DeadlyBrad42
Last active October 13, 2015 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DeadlyBrad42/4164818 to your computer and use it in GitHub Desktop.
Save DeadlyBrad42/4164818 to your computer and use it in GitHub Desktop.
Add classes on the body to help identify older versions of IE
<!-- Conditional HTML declaration for targetting specific versions of IE -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<!-- Code the page as you normally would. Remember to use JavaScript to remove the "no-js" class, and replace it with a "js" class to 'prove' that JS is enabled. -->
<!------------------------------------------------------------>
<!-- Alright, these ones are just for fun -->
<!--[if IE 6]>
alert("Fuck you and the browser you rode in on");
<![endif]-->
<!--[if IE 6]> <style> * {font-family: "Comic Sans MS" !important;} </style> <![endif]-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment