티스토리 뷰

  버전별 스타일시트 사용


 <!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="ie7.css" />
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="ie8.css" />
<![endif]-->
<!--[if gte IE 8]>
<link rel="stylesheet" type="text/css" href="ie9.css" />
<![endif]-->
<!--[if !IE]><!-->
<link rel="stylesheet" type="text/css" href="default.css" />
 <!--<![endif]-->


  Internet Explorer Hacks


IE6 Only Hacks

* html input {
     padding:10px;
}


IE7 Only Hacks

*+html input {
     padding:10px;
}

IE8 Only Hacks

input {
     padding:10px\0/;
}


IE7 And IE8 Only Hacks

input {
     padding:10px\9;
}

Not IE7 Hacks

_input {
     padding:10px;
}

Conditional If Statement


<!--[if IE 6]>
     <html class="ie6">
<![endif]-->
<!--[if IE 7]>
     <html class="ie7">
<![endif]-->
<!--[if IE 8]>
     <html class="ie8">
<![endif]-->
<!--[if gte IE 8]>
        <html class="ie9">
<![endif]-->
<!--[if !IE]><!-->
        <html>
 <!--<![endif]-->

Change HTML Element With Javascript

<script type="text/javascript">
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) { //test for MSIE x.x;
 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 if (ieversion>=8)
     //For IE8
     document.getElementsByTagName('html')[0].className+='ie8';
 else if (ieversion>=7)
     //For IE7
     document.getElementsByTagName('html')[0].className+='ie7';
 else if (ieversion>=6)
     //For IE6
     document.getElementsByTagName('html')[0].className+='ie6';
}
</script>

use JQuery

if ($.browser.msie) {
    if(parseInt($.browser.version) == 8){
         //For IE8
         $(“html”).addClass(“ie8″);
    } else if(parseInt($.browser.version) == 7){
         //For IE7
         $(“html”).addClass(“ie7″);
    } else if(parseInt($.browser.version) == 6){
         //For IE6
         $(“html”).addClass(“ie8″);
    }
}

출처 :  http://www.paulund.co.uk/use-different-styles-for-different-internet-explorer-versions

알아두시면 좋은 내용인듯하여 작성합니다.


댓글
D-DAY
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함