Weblog entry #187 for simonw
#187
IE6 min-width hack that worked.
Posted by simonw on Mon 8 Oct 2007 at 11:55
IE 6 lacks "min-width" which is pretty much essential if you want to do any sophisticated layouts in CSS.
Various workarounds exist. The most successful of those I tried involved embedding various Javascript expressions into the CSS for IE 6 only.
When I did this it worked but IE 6 would sometimes go into a tight loop when the Window is resized. The answer is apparently to put some slack in, and test for "less than min width desired plus a few pixels" or some such. Then IE 6 doesn't seem to go into a tight loop as documented here, this seems exactly the opposite of what you would expect to cause a tight loop in this situation, so probably why I Googled up a solution instead of discovering it.
http://www.cameronmoll.com/archives/000892.html
In this case, it does mean that our application resizes horribly, between 915 pixel wide main panel, and 910 pixel wide main panel.
But then again we have bigger problems with IE6 hanging, which I suspect is the much rumoured "too many stylesheet references" bug, but I can't find any documentation on that one (Dear Lazyweb....). I'm not sure I've learnt much CSS on this project, but I can sneeze out web pages that crash IE 6 in my sleep, folks really don't want to be running this browser any more.
Backward compatibility to IE6 is a nightmare, but simply redirecting them to "Get Firefox" is apparently not an option for reasons I vaguely comprehend, but they won't make the Internet any more secure that way.
Various workarounds exist. The most successful of those I tried involved embedding various Javascript expressions into the CSS for IE 6 only.
When I did this it worked but IE 6 would sometimes go into a tight loop when the Window is resized. The answer is apparently to put some slack in, and test for "less than min width desired plus a few pixels" or some such. Then IE 6 doesn't seem to go into a tight loop as documented here, this seems exactly the opposite of what you would expect to cause a tight loop in this situation, so probably why I Googled up a solution instead of discovering it.
http://www.cameronmoll.com/archives/000892.html
In this case, it does mean that our application resizes horribly, between 915 pixel wide main panel, and 910 pixel wide main panel.
But then again we have bigger problems with IE6 hanging, which I suspect is the much rumoured "too many stylesheet references" bug, but I can't find any documentation on that one (Dear Lazyweb....). I'm not sure I've learnt much CSS on this project, but I can sneeze out web pages that crash IE 6 in my sleep, folks really don't want to be running this browser any more.
Backward compatibility to IE6 is a nightmare, but simply redirecting them to "Get Firefox" is apparently not an option for reasons I vaguely comprehend, but they won't make the Internet any more secure that way.