以下是 IE 系列條件註釋的語句速查,包含單一版本判斷與版本區間判斷。
<!--[if IE]> 所有的 IE 都可識別 <![endif]--> <!--[if !IE]><!--> 除 IE 外都可識別 <!--<![endif]-->
<!--[if IE 6]> 僅 IE6 可識別 <![endif]--> <!--[if lt IE 6]> IE6 以下版本可識別 <![endif]--> <!--[if lte IE 6]> IE6 及 IE6 以下版本可識別 <![endif]--> <!--[if gte IE 6]> IE6 及 IE6 以上版本可識別 <![endif]--> <!--[if gt IE 6]> IE6 以上版本可識別 <![endif]-->
<!--[if IE 7]> 僅 IE7 可識別 <![endif]--> <!--[if lt IE 7]> IE7 以下版本可識別 <![endif]--> <!--[if lte IE 7]> IE7 及 IE7 以下版本可識別 <![endif]--> <!--[if gte IE 7]> IE7 及 IE7 以上版本可識別 <![endif]--> <!--[if gt IE 7]> IE7 以上版本可識別 <![endif]-->
<!--[if IE 8]> 僅 IE8 可識別 <![endif]--> <!--[if lt IE 8]> IE8 以下版本可識別 <![endif]--> <!--[if lte IE 8]> IE8 及 IE8 以下版本可識別 <![endif]--> <!--[if gte IE 8]> IE8 及 IE8 以上版本可識別 <![endif]-->
<!--[if IE 9]> 僅 IE9 可識別 <![endif]--> <!--[if lt IE 9]> IE9 以下版本可識別 <![endif]--> <!--[if IE 10]> 僅 IE10 可識別 <![endif]--> <!--[if lt IE 10]> IE10 以下版本可識別 <![endif]-->
lt:less than,小於(不含等於)lte:less than or equal,小於或等於gt:greater than,大於(不含等於)gte:greater than or equal,大於或等於!:不等於條件註釋只在 IE5 到 IE9 之間有效,IE10 已移除對它的支援,IE11 更不解析。因此這份速查表在今日的實際用途,主要是維護那些還在服役的老舊系統。
如果是新專案需要處理跨瀏覽器差異,建議改用特性偵測(feature detection)而非瀏覽器偵測。例如 Modernizr 可以在頁面中標記出瀏覽器支援了哪些 API,讓你依「能力」而非「版本」決定要載入什麼。這種做法更耐用,因為它關心的是「這個瀏覽器能不能做這件事」,而不是「這個瀏覽器是誰」。