基本上,我正在为IE的不同版本优化一个网站。我使用的是IE9 (通过IE的about页面验证)。
在本地(使用xampp),网站会正确地检测到浏览器是IE9,并加载正确的css代码。但是,当我将代码放到文本服务器上时,它将浏览器视为IE7。
对于测试:
使用xmapp在本地获得的输出
According to the conditional comment this is IE
According to the conditional comment this is IE 9
According to the conditional comment this is IE 8 or higher
According to the conditional comment this is IE greater than 6我在测试服务器上得到的输出:
According to the conditional comment this is IE
According to the conditional comment this is IE 7
According to the conditional comment this is IE lower than 9
According to the conditional comment this is IE lower or equal to 7
According to the conditional comment this is IE greater than 6有没有关于这个问题的想法?
编辑:我用来检查版本的东西
<!--[if IE]>
According to the conditional comment this is IE<br />
<![endif]-->
<!--[if IE 6]>
According to the conditional comment this is IE 6<br />
<![endif]-->
<!--[if IE 7]>
According to the conditional comment this is IE 7<br />
<![endif]-->
<!--[if IE 8]>
According to the conditional comment this is IE 8<br />
<![endif]-->
<!--[if IE 9]>
According to the conditional comment this is IE 9<br />
<![endif]-->
<!--[if gte IE 8]>
According to the conditional comment this is IE 8 or higher<br />
<![endif]-->
<!--[if lt IE 9]>
According to the conditional comment this is IE lower than 9<br />
<![endif]-->
<!--[if lte IE 7]>
According to the conditional comment this is IE lower or equal to 7<br />
<![endif]-->
<!--[if gt IE 6]>
According to the conditional comment this is IE greater than 6<br />
<![endif]-->
<!--[if !IE]> -->
According to the conditional comment this is not IE<br />
<!-- <![endif]-->发布于 2011-11-19 02:53:03
尝试在head部分中添加此meta:
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>和这个doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">
<html>https://stackoverflow.com/questions/8187346
复制相似问题