티스토리 뷰
버전별 스타일시트 사용
<!--[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
Conditional If Statement
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;
}
<!--[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
알아두시면 좋은 내용인듯하여 작성합니다.
'웹개발 > HTML&CSS' 카테고리의 다른 글
IE 에서 'position:fixed' 를 줘보자. (0) | 2013.04.02 |
---|---|
css3 , 트랜지션 애니메이션 예제 (0) | 2012.12.13 |
에디터플러스 젠코딩(zen coding) 활용하기 (0) | 2012.05.16 |
트위터 css , 이미지 버튼 (0) | 2012.02.03 |
HTML5 개발자 API 가이드 (0) | 2012.01.18 |
댓글