!IEMobile | ||||
IEMobile | ||||
!IE | ||||
IE | ||||
lte IE 5 | IE 5 | gte IE 5 | gt IE 5 | |
lte IE 5.0 | IE 5.0 | gte IE 5.0 | gt IE 5.0 | |
lt IE 5.0100 | lte IE 5.0100 | IE 5.0100 | gte IE 5.0100 | gt IE 5.0100 |
lt IE 5.5000 | lte IE 5.5000 | IE 5.5000 | gte IE 5.5000 | gt IE 5.5000 |
lt IE 6.0 | lte IE 6.0 | IE 6.0 | gte IE 6.0 | gt IE 6.0 |
lt IE 6 | lte IE 6 | IE 6 | gte IE 6 | gt IE 6 |
lt IE 7.0 | lte IE 7.0 | IE 7.0 | gte IE 7.0 | gt IE 7.0 |
lt IE 7 | lte IE 7 | IE 7 | gte IE 7 | gt IE 7 |
lt IE 8.0 | lte IE 8.0 | IE 8.0 | gte IE 8.0 | gt IE 8.0 |
lt IE 8 | lte IE 8 | IE 8 | gte IE 8 | gt IE 8 |
lt IE 9.0 | lte IE 9.0 | IE 9.0 | gte IE 9.0 | gt IE 9.0 |
lt IE 9 | lte IE 9 | IE 9 | gte IE 9 | gt IE 9 |
lt IE 10.0 | lte IE 10.0 | IE 10.0 | gte IE 10.0 | gt IE 10.0 |
lt IE 10 | lte IE 10 | IE 10 | gte IE 10 | gt IE 10 |
lt IE 11.0 | lte IE 11.0 | IE 11.0 | gte IE 11.0 | gt IE 11.0 |
lt IE 11 | lte IE 11 | IE 11 | gte IE 11 | gt IE 11 |
lt IE 12.0 | lte IE 12.0 | IE 12.0 | gte IE 12.0 | gt IE 12.0 |
lt IE 12 | lte IE 12 | IE 12 | gte IE 12 | gt IE 12 |
IE 5 | IE 5.0 | IE 5.00 | IE 5.000 | IE 5.0000 | IE 5.00000 | gt IE 5 or !IE | gt IE 5 or !IE |
IE 5 | IE 5.0 | IE 5.01 | IE 5.010 | IE 5.0100 | IE 5.01000 | gt IE 5.0100 or !IE | gt IE 5.0100 or !IE |
IE 5 | IE 5.5 | IE 5.50 | IE 5.500 | IE 5.5000 | IE 5.50000 | gt IE 5.5000 or !IE | gt IE 5.5000 or !IE |
IE 6 | IE 6.0 | IE 6.00 | IE 6.000 | IE 6.0000 | IE 6.00000 | gt IE 6 or !IE | gt IE 6 or !IE |
IE 7 | IE 7.0 | IE 7.00 | IE 7.000 | IE 7.0000 | IE 7.00000 | gt IE 7 or !IE | gt IE 7 or !IE |
IE 8 | IE 8.0 | IE 8.00 | IE 8.000 | IE 8.0000 | IE 8.00000 | gt IE 8 or !IE | gt IE 8 or !IE |
IE 9 | IE 9.0 | IE 9.00 | IE 9.000 | IE 9.0000 | IE 9.00000 | gt IE 9 or !IE | gt IE 9 or !IE |
IE 10 | IE 10.0 | IE 10.00 | IE 10.000 | IE 10.0000 | IE 10.00000 | gt IE 10 or !IE | gt IE 10 or !IE |
IE 11 | IE 11.0 | IE 11.00 | IE 11.000 | IE 11.0000 | IE 11.00000 | gt IE 11 or !IE | gt IE 11 or !IE |
IE 12 | IE 12.0 | IE 12.00 | IE 12.000 | IE 12.0000 | IE 12.00000 | gt IE 12 or !IE | gt IE 12 or !IE |
Each of the expressions for Conditional Comments give either “true” or “false” (for the latter, to be more precisely, their negations give “true”):
As you can see, all expressions work correctly. The test checks for variations on version numbers, most of which are supposed to be acceptable syntax according to Microsoft.
Problems occur in IE 5.5 (only “IE 5.5000” works) and old versions of IE 5.0 (in IE 5.01 only “IE 5.0100” works, so if you want to target all IE 5.0 versions you need to check for “IE 5.0 or IE 5.0100”), so this table may give you some reasoning why to avoid those problematic version numbers in your CC’s.
Note: Support for Conditional Comments is removed in IE 10.
This means you can only use Conditional Comments in IE 10 when using Compatibility View, which makes IE 10 emulate legacy IE versions.
So if you want to target Internet Explorer 5.0-9.0 (and not IE 10 and higher, because of the removal of Conditional Comments support) you can just use “if IE”.
IE 11 bug: In the initial version of IE 11, the reported conditional comment version did not change when emulating document modes via F12 Developer Tools.
This meant conditional comments did not work properly when choosing a document mode through F12 Developer Tools, since the reported version stayed at IE 11 instead of the selected lower IE version. This bug did not occur when forcing a document mode through X-UA-Compatible. If you only used the general “if IE” conditional comment and CSS hacks for matching the proper legacy IE versions you were not affected by this bug.
This bug was fixed in IE 11 Update 1 (“address bugs that include not respecting conditional comments when using F12 to emulate lower document modes.”).
Test Page For Conditional Comments For IE
Created by: Manfred Staudinger
Created on: Febuary 4, 2005
Updated by: Hilbrand Edskes