IE condition comment judgment statement in HTML (<! -- [If xx ie x]> <! [Endif] -->), xxendif
<! -- [If xx ie x]> <! [Endif] --> is a special syntax provided by IE, which is ignored by other browsers as annotations. Purpose: load the corresponding CSS or JS files according to different IE versions, as shown in the following example: (CODE) (Chrome browser) (IE browser) the following column: <! -- [If! IE]> <! --> All except IE can be recognized <! -- <! [Endif] -->
<! -- [If IE]> all IE identifiable <! [Endif] -->
<! -- [If IE 6]> only IE6 can recognize <! [Endif] -->
<! -- [If lt IE 6]> versions earlier than IE6 and IE6 are recognizable <! [Endif] -->
<! -- [If gte IE 6]> IE6 and IE6 and later versions can be recognized <! [Endif] -->
<! -- [If IE 7]> only IE7 is recognizable <! [Endif] -->
<! -- [If lt IE 7]> versions earlier than IE7 and IE7 are recognizable <! [Endif] -->
<! -- [If gte IE 7]> IE7 and IE7 versions can be identified <! [Endif] -->
<! -- [If IE 8]> only IE8 is recognizable <! [Endif] -->
<! -- [If IE 9]> only IE9 can recognize <! [Endif] --> symbol description:
Project |
Example |
Description |
! |
[If! IE] |
The NOT operator. This is placed immediately in front ofFeature,Operator, OrSubexpressionTo reverse the Boolean meaning of the expression. NOT operator. This is an instant front.Function,Operator, OrSubexpressionReturns the meaning of a Boolean expression. |
Lt |
[If lt ie5.5] |
The less-than operator. Returns true if the first argument is less than the second argument. Less than the operator. If the first parameter is smaller than the second parameter, true is returned. |
Lte |
[If lte IE 6] |
The less-than or equal operator. Returns true if the first argument is less than or equal to the second argument. Less than or equal to the operation. If the first parameter is smaller than or equal to the second parameter, true is returned. |
Gt |
[If gt IE 5] |
The greater-than operator. Returns true if the first argument is greater than the second argument. Greater than the operator. If the first parameter is greater than the second parameter, true is returned. |
Gte |
[If gte IE 7] |
The greater-than or equal operator. Returns true if the first argument is greater than or equal to the second argument. Greater than or equal to the operation. If the first parameter is greater than or equal to the second parameter, true is returned. |
() |
[If! (IE 7)] |
Subexpression operators. Used in conjunction with boolean operators to create more complex expressions. Operator of the subexpression. Use the Boolean operator to create more complex expressions. |
& |
[If (gt IE 5) & (lt IE 7)] |
The AND operator. Returns true if all subexpressions evaluate to true AND operator. Returns true if all the subexpressions are calculated as true. |
| |
[If (IE 6) | (IE 7)] |
The OR operator. Returns true if any of the subexpressions evaluates to true. OR operator. Returns true if the subexpression returns true. |