2011-08-27 3 views
1

Firefox, Safari 및 Chrome에서는 작동하지만 IE에서는 작동하지 않습니다. 주어진 width 다음 시도 margin-left:auto;margin-right:auto; 도와주세요.IE에서 그래디언트 래퍼 백그라운드로 콘텐츠 DIV를 센터링하는 방법은 무엇입니까?

여기 http://www.ellenselbiedesign.com/public/testing/index.html

여기 텍스트 정렬을주고 내 CSS

* { 
padding: 0px; 
margin: 0px; 
} 

.wrapper { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -250px; 
background: #aad3d9; /* old browsers */ 
background: -moz-linear-gradient(top, #80BCC5 0%, #ffffff 100%); /* firefox */ 

background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#80BCC5), color-stop(100%,#ffffff)); /* webkit */ 
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#80BCC5', endColorstr='#ffffff',GradientType=0); /* ie */ } /* corresponds to height of #footer */ 

#body-wrapper { 
height: 100%; 
width: 100%; 
} 

#header { 
width: 960px; 
margin-left:auto; 
margin-right:auto; 
} 

#header img { 
padding-top: 15px; 
} 

#header p{ 
color: #784f78; 
font-size: 15px; 
font-family: Arial, Arial, Helvetica, sans-serif; 
font-weight:bold; 
text-align:right; 
margin-top: -33px; 
line-height:90% 
} 
+0

도 div : 100 %를 쓰지 않습니다. 그것은 좋지 않습니다 (즉, 패딩을 추가하면 중단됩니다). 자동으로 사용 가능한 공간을 채 웁니다. – mreq

답변

0

의 링크입니다 : 센터; 부모 요소와 요소 자체

#body-wrapper { text-align: center } 
.wrapper { text-align: left } 
1

<!-- https://stackoverflow.com/questions/4657553/how-to-get-css3-gradient-to-span-the-height-of-the-entire-page-not-just-the-view -->

축하에서 왼쪽으로 다시 설정합니다. 이제 IE가 Quirks 모드로 전환되었습니다. Quirks 모드에서 IE는 IE5.5와 같은 역할을하므로 margin: 0 auto을 지원하지 않습니다. <!DOCTYPE> 전에 코멘트를 제거하려고 시도한 후 <!DOCTYPE> 전에 IE가 쿼크 모드를 사용하게합니다.

관련 문제