Question

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.

Was it helpful?

Solution

To answer one part of your question, which no-one seemed to answer explicitly and I have been trying to figure out ...

is it lt or lte?

Without realising what lt and lte are, you might be unsure which to use, however from reading other comments, I realised that lt = less than and lte = less than or equal to (similary gt and gte are greater than and greater than or equal to), so it depends which versions of IE you want the rule to apply to as to whether you use lt, lte or a combination.

OTHER TIPS

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.

I suppose you can look at it as an expression:

<!--[if expression]> HTML <![endif]-->

Another example would also work:

<!--[if true]> HTML <![endif]-->

About conditions

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top