tags:

views:

132

answers:

2
+2  A: 

Something like this works in IE 7 & FF 3 for me:

<div style="width: 49%; min-width: 300px; float: left; background: red;">Test</div>
<div style="width: 50%; min-width: 300px; float: left; background: blue">Test</div>

Problem is it won't center align when shrunk, and IE 6 hates min-width.

Still looking into center align...

Firefox only:

<div style="text-align: center">
  <div style="display: inline-block; width: 49%; min-width: 300px; margin: 0 auto; background: red;">Test</div>
  <div style="display: inline-block; width: 50%; min-width: 300px; margin: 0 auto; background: blue;">Test</div>
</div>
Mike Robinson
Actually, your last variant also works in Opera, Chrome and Safari. But ie.. you know)
Roman
Curse you BILL GAAAAATES!
Mike Robinson
+1  A: 

If i understand your question correctly, you want the outter box to never become so narrow, that the two inside are positioned over one another?

Put minimum-width on the outter box as well, that equals the summed up min-width, padding, margin and borders of the two inner ones. You can pretend to have min-width in IE6 as well, in this way:

min-width: 200px;
width: auto!important;
width: 200px; /* The last one will be used by IE6 (as min-width), the !important one by standards compliant browsers */

Should also work with min-height.

Arve Systad
Personally, I'd wrap the IE6-specific styles in a conditional comment rather than using a CSS hack.
Ben Blank