开发者

Align a DIV to the right of a fixed width left bar

With a fluid layout, trying to have a 200px left bar and the right div should expand width wise. When some wide content goes in (say a table with a few columns), if the browser isn't wide enough, the right div gets pushed down below the left bar.

How can I sort this?

#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 ben开发者_运维问答eath the leftBar div
 </div> 
 <div class="clear"></div> 
</div>


The correct solution is here:

In CSS, how do I get a left-side fixed-width column with a right-side table that uses the rest of the width?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜