2

我正在为 IE6 添加一个额外的样式表

<!--[if IE 6]>
        <link href="../../nCss/comunHome_ie6.css" rel="stylesheet" type="text/css" />
<![endif]-->

但也影响到 IE7,

编辑-

即使

<!--[if lte IE 6]>
        <link href="../../nCss/comunHome_ie6.css" rel="stylesheet" type="text/css" />
<![endif]-->

知道为什么吗?

-edit2-

此外,与

    function isIE()
                // Returns the version of Internet Explorer or a -1
                // (indicating the use of another browser).
                {
                  var rv = -1; // Return value assumes failure.
                  if (navigator.appName == 'Microsoft Internet Explorer')
                  {
                    var ua = navigator.userAgent;
                    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
                    if (re.exec(ua) != null)
                      rv = parseFloat( RegExp.$1 );
                  }
                  return rv;
                }
alert(isIE());  

它输出 7...

4

2 回答 2

1

您也可以为 IE 7 添加一个选项吗?

<!--[if IE 7]>
Special instructions for IE 7 here
<![endif]-->

嗯,我想你可以使用 if 和 if !

示例用法如果我认为这应该可行..

<!--[if (IE 6)&(!IE 7)]>
于 2011-10-27T07:43:26.553 回答
1

试试<!--[if lt IE 7]>,也可以用一些 js 插件测试浏览器版本,以确保您使用的是 IE6 而不是 IE7

于 2011-10-27T07:46:26.157 回答