2014-07-05 25 views
-1

頁腳div不會在其他div下對齊,但看起來像內容div一樣高。 (在內容和邊欄div之間可見)div盒不會在其他div下對齊

這是什麼解決方案? (什麼是問題,我想知道,太)

#container{ 
    width:1200px; 
    margin:10px auto; 
} 

#content{ 
    width:65%; 
    min-height:350px; 
    margin:10px 10px 0 0; 
    background-color:#f6904e; 
    float:left; 
} 

#sidebar{ 
    width:410px; 
    min-height:350px; 
    margin:10px 0 0 0; 
    background-color:#fddc68; 
    float:right; 
} 


#footer{ 
    margin-top:10px; 
    width:100%; 
    height:20px; 
    background-color:#de3643; 
} 

http://jsfiddle.net/HwM8M/

回答

0

試試這個:

<div style="clear:both;"> 
<div id="footer"> 
    Wouter Schaeffer 
</div> 

Demo

2

#footer添加display:inline-block

#footer{ 
    margin-top:10px; 
    width:100%; 
    height:20px; 
    background-color:#de3643; 
    display:inline-block;/*Add this*/ 
} 

fiddle