Can <!--[if lte IE 8]> even work in IE6?

cocoa coder picture cocoa coder · Mar 1, 2012 · Viewed 13.2k times · Source

I am just about at making my website compatibility, and with IE, the old jerk, I need to use

<!--[if lte IE 8]>

<![endif]-->

However, as "lte IE8" means "equal to or less than IE8", how can IE6 even read this ?

Also, is it lt or lte ? http://www.quirksmode.org/css/condcom.html refers both, though only lte in it's definition.

Answer

Dai picture Dai · Mar 1, 2012

Conditional comments are forwards-compatible. IE detects the number after the "IE" token and compares it to its current version. It doesn't have a built-in whitelist "IE7, IE8" or anything. It will work.