IE7如何使用[如果IE 6]? [英] how can [if IE 6] can be taken by IE7?

查看:97
本文介绍了IE7如何使用[如果IE 6]?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为IE6添加一个附加样式表

I am adding an aditional stylesheet for 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 ...

推荐答案

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

You could just add an option for IE 7 aswell?

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

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

Hmm I suppose you could use if and if !

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

Example usage IF I think this should work..

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

这篇关于IE7如何使用[如果IE 6]?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆