CSS: Floating DIV content spilling outside of container when using min-width. Rather have scrollers -
hoping 1 of guys know answer this.
i have 2 floating divs , 1 div containers content has min-width. when resize window , window smaller min-width content, content spills out of parent container.
i parent container expand accomodate rather have inside min-content spill out , horizontal scrollers @ bottom of browser.
anyone know solution?
<html> <style> .outer { width:100%; border:2px solid green; position:relative; } .left { float:left; width:20%; max-width:250px; background:red; } .right { float:left; width:80%; background:#eee; } .inner { min-width:620px; border:1px solid blue; } .clear { clear:both; } </style> <div class='outer'> <div class='left'>this inner content page. inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.</div> <div class='right'> <div class='inner' class='clear'>this inner content page. inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.</div> <div class='inner' class='clear'>this inner content page. inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.this inner content page.</div> </div> <div style='clear:both'></div> </div>
would scrollers appear horizontally on browser window (and not div) expands.
you setting width on top parent 100%. not grow larger it's parent, body
in case. if want make .outer
element larger can specify fixed width, http://jsfiddle.net/etcf2/.
with , min-width
removed floated elements behave expected.
Comments
Post a Comment