첫번째 방법

/* IE10+ */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
 /* Enter your style code */
}
 
/* IE6,7,9,10 */
@media screen and (min-width: 640px), screen\9 {
 /* Enter your style code */
}
 
/* IE6,7 */
@media screen\9 {
 /* Enter your style code */
}
 
/* IE8 */
@media \0screen {
 /* Enter your style code */
}
 
/* IE6,7,8 */
@media \0screen\,screen\9 {
 /* Enter your style code */
}
 
/* IE9,10 */
@media screen and (min-width:0\0){
 /* Enter your style code */
}

IE는 이제 10미만은 거의 사용되지 않는다

특이사항이 없다면 제일 위의 코드로 IE10+만 해줘도 충분할 것

 

두번째 방법

<!--스타일 시트를 따로 빼버리는 방법-->
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="only-ie.css" />
<![endif]-->
 

<!--HTML안에 스타일CSS를 바로 입력하는 방법-->
<!--[if IE]>
<style>
    /* Enter your style code */
</style>
<![endif]-->

<!–[if IE]>, <![endif]–> 를 이용하는 방법

이것도 버전별로 코딩이 있는데 필요하다면 마이크로소프트 홈페이지를 참고

다만 스택오버플로 사이트 댓글에 ‘not working in IE11’ 이 있는 걸 보니 IE10까지만 지원하는 것 같다.

+ Recent posts