我正在尝试使用条件注释来破解 IE7 使其表现得像一个真正的浏览器。
但是最近几天,IE7 忽略了引用它的条件,只响应针对 IE8 的条件。
我的标题有:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1 /DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
...
条件是:
<!--[if IE 7]>
<link rel="stylesheet" href="/css/ieHacks.css" type="text/css" media="screen" />
<![endif]-->
在 IE7 或 8 中都无法识别。但如果是
<!--[if IE 8]>
<link rel="stylesheet" href="/css/ieHacks.css" type="text/css" media="screen" />
<![endif]-->
然后样式表在 IE7 和 IE8 中都呈现。
有任何想法吗?我难住了。