Почему эти Условные комментарии говорят мне, что IE8 - это IE7? - PullRequest
3 голосов
/ 24 марта 2011

Зачем использовать эту HTML-страницу в Internet Explorer 8:

<p>
<!--[if IE]> According to the conditional comment this is Internet Explorer<br /><!    [endif]-->
<!--[if IE 5]> According to the conditional comment this is Internet Explorer 5<br /> <![endif]-->
<!--[if IE 5.0]> According to the conditional comment this is Internet Explorer 5.0<br /> <![endif]-->
<!--[if IE 5.5]> According to the conditional comment this is Internet Explorer 5.5<br /> <![endif]-->
<!--[if IE 6]> According to the conditional comment this is Internet Explorer 6<br /> <![endif]-->
<!--[if IE 7]> According to the conditional comment this is Internet Explorer 7<br /> <![endif]-->
<!--[if gte IE 5]> According to the conditional comment this is Internet Explorer 5 and up<br /><![endif]-->
<!--[if lt IE 6]> According to the conditional comment this is Internet Explorer lower than 6<br /> <![endif]-->
<!--[if lte IE 5.5]> According to the conditional comment this is Internet Explorer lower or equal to 5.5<br /> <![endif]--> 
<!--[if gt IE 6]> According to the conditional comment this is Internet Explorer greater than 6<br /> <![endif]--> 
</p>

Я получил этот результат?

According to the conditional comment this is Internet Explorer
According to the conditional comment this is Internet Explorer 7
According to the conditional comment this is Internet Explorer 5 and up
According to the conditional comment this is Internet Explorer greater than 6

Разве я не должен получить IE8?

Спасибо.

Ответы [ 2 ]

5 голосов
/ 24 марта 2011

Единственный комментарий, который отображается неверно, это

Согласно условному комментарию, это Internet Explorer 7

Является ли браузер в режиме совместимости, поскольку он будет отображаться как IE7

2 голосов
/ 24 марта 2011

Для локальных документов IE8 имеет тенденцию автоматически использовать режим совместимости IE7.В этом случае IE8 работает так, как если бы это был IE7 (с несколькими причудами).

Вы либо тестируете это локально, либо ваш браузер в настоящее время установлен в режим совместимости IE7.

...