CSS validation

Hi!

I have this code in my CSS. It is said to be a fix for a bug in IE6:

#container {
min-width:1001px;
max-width:1024px;
_width:expression( ( (document.compatMode && document.compatMode=='CSS1Compat') ? document.documentElement.clientWidth : document.body.clientWidth) < 1001 ? "1001px" : ( (document.compatMode && document.compatMode=='CSS1Compat') ? document.documentElement.clientWidth : document.body.clientWidth) > 1024 ? "1024px" : "auto");
margin:0 auto;
padding:0;
}

Unfortunately, it does not pass CSS validation. Does someone know about this CSS piece of code and if there a way to not use it, but use something else instead, to make sure the CSS validates?

Thanks.

Using _width will not pass validation, but you can solve that by using a selector that only IE6 (and IE5) will match (e.g., * html #container).

The use of expression() will never validate, though. You could put all the IE-only stuff in a separate style sheet and include it via conditional comments. That way you can keep the main style sheet valid.

<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" href="/css/ie.css" media="screen">
<![endif]-->