Paola_V Paola_V - 1 year ago 85
HTML Question

Conditional comments syntax

Can anyone explain me the difference between first and second conditional comment syntax?

<!--[if lt IE 8]><html class="no-js lt-ie8"><![endif]-->
<!--[if gt IE 8]><!--><html class="no-js"><!--<![endif]-->

Why the second one use use the
syntax before
tag? Can I use the following syntax with the same result?

<!--[if lt IE 8]><html class="no-js lt-ie8"><![endif]-->
<!--[if gt IE 8]><html class="no-js"><![endif]-->

Thanks in advance!

Answer Source

No, your second setup will not be the same as your first.

In the first, where <!--[if gt IE 8]><!--><html class="no-js"><!--<![endif]--> is used, it will let all other browsers (the one's that does not understand conditional comments) to have <html class="no-js">, which the second setup won't


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download