質問

In modern web pages you often see something like:

<!--[if IE 7]>
<html class="ie ie7" lang="en-US">
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" lang="en-US">
<![endif]-->
<!--[if !(IE 7) | !(IE 8)  ]><!-->
<html lang="en-US">
<!--<![endif]-->

The purpose is obviously to apply different html, depending on browser and browser version. I assume this is done server side, as it seems everything except the appropriate parts are commented out.

What software is used on the server to select which part to comment out depending on the visiting browser?

役に立ちましたか?

解決

Those are conditional comments. They are parsed (contrary to the HTML spec), client side, by Internet Explorer (versions 5-9). Everything else (including IE 10) treats them as regular comment syntax.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top