how can [if IE 6] can be taken by IE7?

左心房为你撑大大i 提交于 2020-01-24 12:23:46

问题


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...


回答1:


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)]>



回答2:


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



来源:https://stackoverflow.com/questions/7912915/how-can-if-ie-6-can-be-taken-by-ie7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!