2011-07-26 13 views
0

私が行っているページに問題があります。コードのフッタ付き100%容器の高さ

Aスニペット: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; 
} 

Iコンテナがフッターにヘッダからなりたいは、Iコードとヒントを適用しようとしました私は見つけたが、成功していない。回答を感謝する!

+1

Googleに書きます。 – Litek

+0

これを見てください:http://ryanfait.com/resources/footer-stick-to-bottom-of-page/ – Tobi

答えて

1
#content{ 
height:100%; 
} 

これは、コンテンツdivが親コンテナの100%(この場合はhtml)を占めることを意味します。

だから、スティッキーフッター

html{ 
height:100%; 
} 
関連する問題