2010-06-27 117 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

回答