2010-06-27 84 views
0

使用流體佈局,嘗試使用200px左側欄和右側div應展開寬度。當一些廣泛的內容進入(比如說一個有幾列的表格)時,如果瀏覽器不夠寬,右邊的div會被推到左邊的欄下面。將DIV對齊固定寬度左側欄

我該如何分類?

#container{ 
    min-height:300px; 
} 
#leftBar{ 
    width:200px; 
    float:left; 
} 
#content{ 
    float:left; 
    padding:20px; 
} 

<div id="container"> 
<div id="leftBar"> 
    Left bar here fixed width 200px 
</div> 
<div id="content"> 
    Should expand to fit parent div, but any long content pushes this beneath the leftBar div 
</div> 
<div class="clear"></div> 
</div> 
+0

任何想法嗎? – 2010-06-28 08:46:26

+0

[在CSS中,我如何獲得左側固定寬度的列與使用其餘寬度的右側表?]可能的副本(http://stackoverflow.com/questions/468038/in- css-how-do-i-get-a-left-side-fixed-width-column-with-a-right-table-that) – 2012-06-17 23:32:44

+0

[如何獲得固定寬度DIV內的浮動DIV繼續水平?](http://stackoverflow.com/questions/1015809/how-to-get-floating-divs-inside-fixed-width-div-to-continue-horizo​​ntally) – rds 2013-12-05 16:42:42

回答

相關問題