2011-07-26 4 views
0

내가하는 페이지에 문제가 있습니다. 코드의꼬리말이있는 100 % 컨테이너 높이

코드 조각은 : CSS를 이제

<div id="header"> // header.. 
</div> 
<div id="content"> // content where ajax is loaded (should be atleast 100% of the site height) 
    <!-- ajax --> 
</div> 
<div id="footer"> //empty atm. 

</div> 

:

#content{ 
    margin-left:auto; 
    margin-right:auto; 
    background-color:#767670; 
    width:800px; 
    border-left:1px solid #9F9793; 
    border-right:1px solid #9F9793; 
    position:relative; 
    height:auto !important; /* real browsers */ 
    height:100%; /* IE6: treaded as min-height*/ 
    min-height:100%; /* real browsers */ 

} 
#footer{ 
    width:100%; 
    height:40px; 
    border-top:1px solid #9F9793; 
    border-bottom:1px solid #9F9793; 
    background-color:#767670; 
} 

내가 용기 바닥 글에 헤더가되고 싶어요, 나는 코드 및 팁을 적용하려 나는 성공했지만 성공하지 못했습니다. 답변을 감사드립니다!

+1

구글 물품. – Litek

+0

이것 좀보세요 : http://ryanfait.com/resources/footer-stick-to-bottom-of-page/ – Tobi

답변

1
#content{ 
height:100%; 
} 

이것은 콘텐츠 컨테이너 div가 상위 컨테이너 (이 경우 html)의 100 %를 차지함을 의미합니다.

그래서 끈적 끈적한 바닥 글

html{ 
height:100%; 
}