정보
IE 호환성 유지하기
별제이
2012. 7. 16. 15:35
Internet Explorer를 사용하다 보면 브라우저 모두 및 문서 모드가 변경 되어 원하는 형태로 보이지 않는 경우가 있다.
이를 해결 하기 위해 <head> 태그 사이이 아래 태그를 사용하면 된다.
<meta http-equiv=”X-UA-Compatible” content=”IE=7″ />
or
<meta http-equiv=”X-UA-Compatible” content=”IE=8″ />
본문에 모두 넣어야 하는 불편함이 있겠지?
그럴땐, web.config 파일을 만들어 해당 웹서버 루트에 설치하는 방법도 있다.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<clear />
<add name="X-UA-Compatible" value="IE=EmulateIE7" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
아니면, 웹서버의 설정을 바꾸는 것도 한 방법이다.
IIS7 이상에서는 HTTP 응답헤더에 헤더 값을 넣으면 된다.
IIS 6 에서는 아래와 같이 하면 된다.
@IM