【问题标题】:Align a DIV to the right of a fixed width left bar将 DIV 对齐到固定宽度左栏的右侧
【发布时间】:2011-03-08 22:12:24
【问题描述】:

对于流畅的布局,尝试让左栏和右 div 有 200 像素的宽度应该会扩大。当一些宽的内容进入时(比如一个有几列的表格),如果浏览器不够宽,右边的 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>

【问题讨论】:

标签: html css-float fluid liquid-layout


【解决方案1】:
猜你喜欢
  • 1970-01-01
  • 2012-01-05
  • 1970-01-01
  • 1970-01-01
  • 2012-07-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多