Solution (Clean Markup Solution) - with Side Effects
Date of the Solution
Sat Jul 18 14:39:16 2009
Fixed Versions
all of the affected
Description
This solution is a rather bold statement and requires one to edit the markup, let's take a look at the fixed demo first:
Due to the nature of the bug, the demo is shown on a separate page.
- HTML Code:
<div id="content">
<div id="width"></div>
Foo Bar Baz
</div>
- CSS Code:
#content {
width: 50%;
min-width: 500px;
background: #aaa;
border: 1px solid #000;
}
#width {
width: 500px;
height: 0;
overflow: hidden;
}
So what did we do here... we stuck a <div> inside our <div> with min-width and set width on it to the same value as min-width on its parent. Simple as pie, the extra inner <div> prevents our otter <div> from going below the width of our inner <div>... simple and effective.
Side Effects
The side effect of this solution is that if the outter div (#content) would to have overflow set to anything but visible the fix would not work.