[如果是IE 6]怎么能被IE7拿走呢?

发布于 2024-12-12 02:06:31 字数 1102 浏览 0 评论 0原文

我正在为 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...

I am adding an aditional stylesheet for IE6

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

but is affecting to IE7 aswell,

edit-

even with

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

Any idea why?

-edit2-

Also, with

    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());  

it outputs 7...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时光是把杀猪刀 2024-12-19 02:06:31

您也可以添加 IE 7 的选项吗?

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

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

示例用法如果我认为这应该有效..

<!--[if (IE 6)&(!IE 7)]>

You could just add an option for IE 7 aswell?

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

Hmm I suppose you could use if and if !

Example usage IF I think this should work..

<!--[if (IE 6)&(!IE 7)]>
眼泪也成诗 2024-12-19 02:06:31

尝试

Try <!--[if lt IE 7]>, also test browser version with some js plugin to be sure that you are working on IE6 not IE7

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文