The common form of HTML annotations is
<!-- -
and IE5~IE9 these 5 versions of IE browser also support a special if condition comment (feel a bit like the syntax structure when template rendering)
<!-- [if ie]> HTML statement <! [EndIf] -
This way, when dealing with IE compatibility issues, you can put the hack code together, or other unexpected uses
If condition comment is divided into three forms
1, whether IE (that is:!)
<!-- [if ie]> HTML code <! [EndIf] - <!-- [if! Ie]> HTML code <! [EndIf] -
2, which version of IE (i.e.: =)
<!-- [if IE 6]> HTML code <! [EndIf] - <!-- [if IE 8]> HTML code <! [EndIf] -
3, which is the interval of IE (i.e.: <,<=,>,>=)
<!---<!--[if LT IE 8]> html code <![ ENDIF]-<!---<!--[if GT IE 7]> HTML code < ! [EndIf] -
The above code only IE5~IE9 to recognize the middle of the HTML code, and IE10,IE11 and non-IE will be recognized as a whole comment, they only use the tube "<!--" and "--" on the line, as far as the middle is a bunch of characters.
So if you want the so-called HTML code in the IF condition comment to be recognized but not executable, and other browsers are not recognized but can execute, you can write this IE5~IE9
<!-- [if! ie]>-<!--<![ ENDIF] -
The idea is to comment out the first and last parts of the syntax structure of the conditional annotation, when the IE5~IE9 still recognizes the middle HTML code (the feeling condition annotation is higher than the normal annotation priority level has the wood has ), just before and after each more "--" and "<!--" Insignificant characters, and other browsers also recognize the middle HTML code, just a lot of irrelevant comments.
A point of note for individuals who feel the use of conditional annotations
<!-- [if! Ie]>-<src= "Js/jquery-3.2.1.min.js"></ script><!--<![ ENDIF]-<!--[if Ie]><script src= "Js/jquery-1.12.4.min.js" ></ script><! [EndIf] -
Is that in all browsers can only use one of the words must remember to consider IE9, because it is also able to recognize the conditional annotation ( feel IE9 is ie to modern advanced browser of the transition, CSS3 only support a part, but before IE proprietary problems still exist )
HTML Conditional Comment