2011-12-16 5 views
0

MVC3을 사용하여 간단한 응용 프로그램을 만들었으며 사이트는 기본 템플릿을 기반으로합니다.IE9를 사용하여 MVC3을 사용하는 일관되지 않은 레이아웃

IE9와 Chrome을 사용하여 제대로 표시되지만 사이트 (Windows Server 2003)에 배포 할 때 로컬로 사이트를 실행하면 내 컴퓨터에서 페이지가 잘못 렌더링됩니다.

다음은 이상한 비트입니다 ... 서버 (IE8)의 브라우저에서 사이트를 볼 때 다시 올바르게 렌더링됩니다.

문제는 이것입니다 원인이 될 것으로 보인다 CSS 파일의 섹션 ... 여기

header, #header 
{ 
    position: relative; 
    margin-bottom: 0px; 
    color: #000; 
    padding: 0; 
    height: 135px; 
} 

header h1, #header h1 
{ 
    font-weight: bold; 
    padding: 5px 0; 
    margin: 0; 
    color: #fff; 
    border: none; 
    line-height: 2em; 
    font-size: 32px !important; 
    text-shadow: 1px 1px 2px #111; 
} 

#main 
{ 
    padding: 30px 30px 15px 30px; 
    background-color: #fff; 
    border-radius: 4px 0 0 0; 
    background-image: url(themes/base/images/ss_bg.gif); 
    background-repeat: repeat; 
    -webkit-border-radius: 4px 0 0 0; 
    -moz-border-radius: 4px 0 0 0; 
} 

footer, 
#footer 
{ 
    background-image: url(themes/base/images/2bg.gif); 
    background-repeat: repeat; 

    font-family: Courier; 
    font-size: .9em; 
    font-weight: normal; 
    font-style: normal; 
    font-variant: normal; 
    color: Gray; 

    padding: 10px 0; 
    text-align: center; 
    line-height: normal; 
    margin: 0 0 30px 0; 
    border-radius: 0 0 4px 4px; 
    -webkit-border-radius: 0 0 4px 4px; 
    -moz-border-radius: 0 0 4px 4px; 
} 

는 일부 스크린 샷은 다음과 같습니다

IE 9의 잘못된 렌더링 Incorrect Rendering

IE 8에서 로컬로 올바른 렌더링 Correct Rendering

답변

2

개발자 도구를 열려면 F12 키를 누릅니다. 그러면 IE가 사이트의 두 인스턴스간에 동일한 "브라우저 모드"/ "문서 모드"를 사용하지 않는다는 것을 나타내야합니다.

IE는 기본적으로 페이지가 제공되는 위치에 따라 다른 모드로 설정되어 있습니다.

<meta http-equiv="X-UA-Compatible" content="IE=edge"> 
+0

브릴리언트 :

당신의 <head>이 추가 문제를 분류해야한다. 고맙습니다. – TeamWild

관련 문제