cocoa coder
cocoa coder

Reputation: 214

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

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.

Upvotes: 1

Views: 13249

Answers (3)

Ben Holness
Ben Holness

Reputation: 2707

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.

Upvotes: 3

filype
filype

Reputation: 8380

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

Upvotes: 0

Dai
Dai

Reputation: 155260

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.

Upvotes: 5

Related Questions