Make IE6 respect width (CSS)

What we do to emulate min-width in IE-6? We apply this css to container:

.container {
height:auto !important;
height:200px;
min-height:200px; }

Here’s what happens: IE 6 doesn’t understand !important, IE6 doesn’t know what min-height is, IE6 doesn’t care about height or width, it enlarges the container, as much as needed to fit content (css for ie6: min-height = height). So we set auto height for normal browsers, then add height for ie6 (acts like min-height) and true min-height for normal browsers.

If IE6 doesn’t respect the height/width, what do we do when we need it to have fixed Height/Width CSS properties?

If we have something like this:

<div class="container">
<div class="fixed-box">
<p>something[..]</p>
</div>
</div>

And we don’t want fixed-box to be larger than 200px in width under any circumstances. But show content that goes beyond fixed-box size, overlapping the container. This helps:

.container {
.fixed-box { overflow:hidden; }
.p { position:relative; }
}
Filed in: Web Development