Back

IE6 and Working Around 'max-width'

NOTE: This article is ridiculously old - if you are still trying to support IE6 then you should consider if its time for a nursing home!

I've found time and time again that when styling a web site, I keep running into issues with CSS compatibility. The primary source of my frustration has consistently been Internet Explorer 6.

Why bother you may say? Everyone is running IE7, aren't they? Maybe not. Many people (though increasingly less) are still running stock Windows XP - often pirated - and therefore have not been eligible for IE7 upgrades. As such, some work arounds are required.

This article focuses on the 'max-width' style which is not supported by IE6.


It's quite simple actually. Where you might have in your style sheet something like...

.myclass { max-width: 170px; ... }

You would instead put...

.myclass { max-width: 170px width: expression(document.body.clientWidth > 170? "170px" : "auto"); ... }

Yup.. that's all there is to it!

Back