views:

300

answers:

2

HTML:

<div id="mcolWrapper">
    <div id="mcol">
      <div class="wrapper">
      content
      </div>
    </div>
</div>

<div id="lcol">
    <div class="wrapper">
    content
    </div>
</div>

<div id="rcol">
    <div class="wrapper">
    content
    </div>
</div>

CSS:

#mcolWrapper {
    float: left;
    width: 100%; }

#mcol { margin: 0 295px 0 235px; min-width: 500px; }

#lcol {
    float: left;
    width: 235px;
    margin-left: -100%; }

#rcol {
    float: left;
    width: 290px;
    margin-left: -295px;

I want to set a minimum width on the center column so it cannot shrink too much and past this minimum width point, I'd like the browser to display a horizontal scroll bar instead of the right column overlapping the center column.

A: 

min-width is not a fully supported css property. An easy way around this in your situation would be to simply add a div at the bottom of the column that has a width equal to your minimum width value.

<div id="mcol">
  ...
  <div style="width:500px;"></div>
</div>

This will cause the column to not be able to shrink any smaller. Hope that helps!

Alex Sexton
Great tip, thanks, but there're hacks for min-width too. The problem here mainly is that beyond the min-width point, right-col overlaps the center-col, whereas I want a horizontal scrollbar to kick in. Possible?
Nimbuz
+1  A: 

You could try the jQuery splitter plugin. It's what I use when I need a column layout, because it does a better job of abstracting away the browser differences than CSS templates do, and it handles the scrollbars flawlessly.

http://methvin.com/splitter/

Robert Harvey
3-col splitter is almost what I want, but still it doesn't add the horizontal scrollbars, just hides the overflowing content when the viewport width < min-width.
Nimbuz
I'm pretty sure there is a setting that will allow you to have horizontal scrollbars. Make sure you have the overflow attribute set to auto on the column div.
Robert Harvey