Created
November 21, 2012 16:25
-
-
Save ataylorme/4125826 to your computer and use it in GitHub Desktop.
PHP moderizr html tags for IE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if( preg_match('/(?i)msie [1-6]/',$_SERVER['HTTP_USER_AGENT']) ){ ?> | |
<!-- the "no-js" class is for Modernizr. --> | |
<html class="ie ie6 no-js"> | |
<?php } elseif( preg_match('/(?i)msie [7]/',$_SERVER['HTTP_USER_AGENT']) ){ //end if IE 6 ?> | |
<!-- the "no-js" class is for Modernizr. --> | |
<html class="ie ie7 no-js"> | |
<?php } elseif( preg_match('/(?i)msie [8]/',$_SERVER['HTTP_USER_AGENT']) ){ //end if IE 7 ?> | |
<!-- the "no-js" class is for Modernizr. --> | |
<html class="ie ie8 no-js"> | |
<?php } elseif( preg_match('/(?i)msie [9]/',$_SERVER['HTTP_USER_AGENT']) ){ //end if IE 8 ?> | |
<!-- the "no-js" class is for Modernizr. --> | |
<html class="ie ie9 no-js"> | |
<?php } elseif( preg_match('/(?i)msie [10]/',$_SERVER['HTTP_USER_AGENT']) ){ //end if IE 9?> | |
<!-- the "no-js" class is for Modernizr. --> | |
<html class="no-js"> | |
<?php } else{ //end if IE 10 ?> | |
<html lang="en-US"> | |
<?php } //end if not IE ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dont forget to link to the Modernizr script in