13.05.06

Simulate CSS min-width for Internet Explorer

Link: http://www.cssplay.co.uk/boxes/minwidth.html

Simulating min-width in Internet Explorer 6 is quite difficult, but here's a very good way of simulating it. It only uses CSS/HTML and no Javascript/expression, though it's still a hack by nature.

Thanks to magnat for sending it to me, after I've given up, because the expression-hack I've previously found failed when Internet Explorer (which sucks btw) is in "standards compliant mode" (in contrast to "quirks mode").

Update:
I've just found a quirk with it:
The basic CSS for IE in standards compliant mode is this:

/* for all browsers that understand min-width */
.width {width:90%; min-width:400px;}

/* the bodge for IE6 browsers */
* html .minwidth {
  border-left:400px solid #fff;
  position:relative;
  float:left;
  z-index:1;
}
* html .container {
  margin-left:-400px;
  position:relative;
  float:left;
  z-index:2;
}

The problem with a more complex layout I just had, was that the text of the page could not get selected/highlighted anymore (by mouse). Removing the emphasized "position:relative" above solved it and had no influence on the efficiency of this workaround.

By Daniel in html / css13/05/06 English (UK) Email

1 comment

Comment from: Mas [Visitor] Email
MasDanke Daniel das das Gaestebuch deiner Mutter wieder gut functioniert!

Wünsche Dir Alles Gute zum naechsten Woche!

Grüsse aus Holland!

Mas
11/06/06 @ 20:21

Leave a comment


Your email address will not be revealed on this site.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)
You can just use your OpenID to provide your name, e-mail and url.
Seitenleiste